[U-Boot] [PATCH 7/8] USB: gadget: ethernet error path potential oops fix

Vitaly Kuzmichev vkuzmichev at mvista.com
Thu Aug 12 14:44:45 CEST 2010


From: David Brownell <david-b at pacbell.net>

Fix potential (never-observed) oops on rare error path,
bugzilla #9594.  Fix uses the same test as used earlier.

Also make the adjacent "else" block look like an "else" block
instead of hiding like a bug.

Signed-off-by: David Brownell <dbrownell at users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>

(cherry picked from commit e7b13ec9235b9fded90f826ceeb8c34548631351)

Conflicts:

	drivers/usb/gadget/ether.c
		Cause: "else" block was removed while porting.
		Removing this part of the patch.

Signed-off-by: Vitaly Kuzmichev <vkuzmichev at mvista.com>
---
 drivers/usb/gadget/ether.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 5710ddf..8f0f5be 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -810,7 +810,7 @@ done:
 
 	/* on error, disable any endpoints  */
 	if (result < 0) {
-		if (!subset_active(dev))
+		if (!subset_active(dev) && dev->status_ep)
 			(void) usb_ep_disable (dev->status_ep);
 		dev->status = NULL;
 		(void) usb_ep_disable (dev->in_ep);
-- 
1.7.1.1



More information about the U-Boot mailing list