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

[Xen-devel] Re: drivers/net/xen-netfront.c: bogus code

To: Adrian Bunk <bunk@xxxxxxxxx>
Subject: [Xen-devel] Re: drivers/net/xen-netfront.c: bogus code
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Sun, 22 Jul 2007 23:46:12 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx>, Jeff Garzik <jeff@xxxxxxxxxx>, netdev@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Chris Wright <chrisw@xxxxxxxxxxxx>
Delivery-date: Sun, 22 Jul 2007 23:44:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070722232618.GO26212@xxxxxxxxx>
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: <20070722232618.GO26212@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.4 (X11/20070615)
Adrian Bunk wrote:
> The Coverity checker spotted the following bogus code
> in drivers/net/xen-netfront.c:
>
> <--  snip  -->
>
> ...
> static void xennet_alloc_rx_buffers(struct net_device *dev)
> {
> ...
>         for (nr_flips = i = 0; ; i++) {
>                 skb = __skb_dequeue(&np->rx_batch);
>                 if (skb == NULL)
>                         break;
>
>                 skb->dev = dev;
>
>                 id = xennet_rxidx(req_prod + i);
>
>                 BUG_ON(np->rx_skbs[id]);
>                 np->rx_skbs[id] = skb;
>
>                 ref = gnttab_claim_grant_reference(&np->gref_rx_head);
>                 BUG_ON((signed short)ref < 0);
>                 np->grant_rx_ref[id] = ref;
>
>                 pfn = page_to_pfn(skb_shinfo(skb)->frags[0].page);
>                 vaddr = page_address(skb_shinfo(skb)->frags[0].page);
>
>                 req = RING_GET_REQUEST(&np->rx, req_prod + i);
>                 gnttab_grant_foreign_access_ref(ref,
>                                                 np->xbdev->otherend_id,
>                                                 pfn_to_mfn(pfn),
>                                                 0);
>
>                 req->id = id;
>                 req->gref = ref;
>         }
>
>         if (nr_flips != 0) {
> ...
>
> <--  snip  -->
>
> Note that "nr_flips" is always 0 in the last line.
>   

Thanks.  That's probably a residual from me removing the page-flipping
code.  I'll give it another pass.

    J

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

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