From b8d297c93a888fcd4d74ba0bbeeabe9b84caf514 Mon Sep 17 00:00:00 2001 From: Erik Hovland Date: Mon, 23 Apr 2007 10:50:15 -0700 Subject: [PATCH] usb ethernet gadget, workaround network stack API glitch Another workaround for the glitch in the network layer, whereby one call ignores the (otherwise kernel-wide) convention that free() calls should not oops when passed nulls. This code already handles that API glitch in most other paths. From: Erik Hovland Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/ether.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 8f9f217e0a68..96df8413f391 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -1735,7 +1735,8 @@ enomem: defer_kevent (dev, WORK_RX_MEMORY); if (retval) { DEBUG (dev, "rx submit --> %d\n", retval); - dev_kfree_skb_any (skb); + if (skb) + dev_kfree_skb_any(skb); spin_lock(&dev->req_lock); list_add (&req->list, &dev->rx_reqs); spin_unlock(&dev->req_lock); -- 2.34.1