[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C3DB927.2060106@redhat.com>
Date: Wed, 14 Jul 2010 09:18:31 -0400
From: Prarit Bhargava <prarit@...hat.com>
To: David Miller <davem@...emloft.net>
CC: netdev@...r.kernel.org
Subject: Re: [RFC PATCH]: Fix a warning in the niu driver
> Your patch would corrupt the list state, since we'd leave
> pages in the rx page hash which have only externally references
> and thus will be freed up.
>
>
Ah ... I totally missed that. Thanks for clarifying that Dave.
> Just BUG() if the loop terminates without finding a page.
>
> --------------------
> niu: BUG on inability to find page in rx page hashes.
>
> Signed-off-by: David S. Miller <davem@...emloft.net>
>
> diff --git a/drivers/net/niu.c b/drivers/net/niu.c
> index 3d523cb..5d36531 100644
> --- a/drivers/net/niu.c
> +++ b/drivers/net/niu.c
> @@ -3330,10 +3330,12 @@ static struct page *niu_find_rxpage(struct rx_ring_info *rp, u64 addr,
> for (; (p = *pp) != NULL; pp = (struct page **) &p->mapping) {
> if (p->index == addr) {
> *link = pp;
> - break;
> + goto found;
> }
> }
> + BUG();
>
> +found:
> return p;
> }
>
Dave, would it be acceptable if I then wrapped link in
uninitialized_var() to get rid of the warning I'm trying to resolve? It
seems that your patch then checks for a valid page value so it should be
okay.
P.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists