WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH][NET] front: cleanup some error paths

To: Chris Wright <chrisw@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH][NET] front: cleanup some error paths
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Fri, 9 Jun 2006 14:11:44 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 09 Jun 2006 06:12:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060608192238.GV29676@xxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060608192238.GV29676@xxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

On 8 Jun 2006, at 20:22, Chris Wright wrote:

There's a small leak on a couple error paths in setup_device().
While there rearrange the ring setup order slightly to simplify error
path since netif_free() will cleanup once ring_ref is valid.  And use
get_zeroed_page() instead of __get_free_page()/memset(). Handle error if
bind_evtchn_to_irqhandler() fails, as bad info->irq value is likely to
cause oops later.  In create_device(), gnttab_free_grant_references()
is accidentally called twice on tx_head during cleanup from failed
gnttab_alloc_grant_references() on rx_head, which could corrupt
gnttab_free_count.

Applied, but I don't think it's a complete fix. For example, shouldn't txs/rxs be freed if bind_evtchn_to_irqhandler() fails? There should probably be more test-and-free cases on the fail path.

 -- Keir


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>