public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/usb/gadget/ether.c: NULL dereference
@ 2006-11-11 16:06 Adrian Bunk
  2006-11-12  6:35 ` [linux-usb-devel] " David Brownell
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2006-11-11 16:06 UTC (permalink / raw)
  To: greg; +Cc: linux-usb-devel, linux-kernel

The Coverity checker spotted the following NULL dereference of "skb" in 
drivers/usb/gadget/ether.c:

<--  snip  -->

...
static int
rx_submit (struct eth_dev *dev, struct usb_request *req, gfp_t gfp_flags)
{
        struct sk_buff          *skb;
        int                     retval = -ENOMEM;
...
        if ((skb = alloc_skb (size + NET_IP_ALIGN, gfp_flags)) == 0) {
                DEBUG (dev, "no rx skb\n");
                goto enomem;
        }
...
enomem:
                defer_kevent (dev, WORK_RX_MEMORY);
        if (retval) {
                DEBUG (dev, "rx submit --> %d\n", retval);
                dev_kfree_skb_any (skb);
...

<--  snip  -->

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-11-12 12:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-11 16:06 drivers/usb/gadget/ether.c: NULL dereference Adrian Bunk
2006-11-12  6:35 ` [linux-usb-devel] " David Brownell
2006-11-12  6:50   ` Adrian Bunk
2006-11-12  7:10     ` David Brownell
2006-11-12 12:23       ` Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox