diff options
author | David Brownell <david-b@pacbell.net> | 2007-12-19 14:27:51 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-01 17:34:58 -0500 |
commit | e7b13ec9235b9fded90f826ceeb8c34548631351 (patch) | |
tree | 59fc534eda674c64c4a23e98b0d13a233579e19a /drivers/usb | |
parent | 340ba5f9cee6c7096162bfb2e0f7589f1ce0e142 (diff) |
USB: gadget: ethernet error path potential oops fix
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@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/ether.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 9e732bff9df0..a70e255402b8 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c | |||
@@ -1067,19 +1067,19 @@ done: | |||
1067 | 1067 | ||
1068 | /* on error, disable any endpoints */ | 1068 | /* on error, disable any endpoints */ |
1069 | if (result < 0) { | 1069 | if (result < 0) { |
1070 | if (!subset_active(dev)) | 1070 | if (!subset_active(dev) && dev->status_ep) |
1071 | (void) usb_ep_disable (dev->status_ep); | 1071 | (void) usb_ep_disable (dev->status_ep); |
1072 | dev->status = NULL; | 1072 | dev->status = NULL; |
1073 | (void) usb_ep_disable (dev->in_ep); | 1073 | (void) usb_ep_disable (dev->in_ep); |
1074 | (void) usb_ep_disable (dev->out_ep); | 1074 | (void) usb_ep_disable (dev->out_ep); |
1075 | dev->in = NULL; | 1075 | dev->in = NULL; |
1076 | dev->out = NULL; | 1076 | dev->out = NULL; |
1077 | } else | 1077 | } |
1078 | 1078 | ||
1079 | /* activate non-CDC configs right away | 1079 | /* activate non-CDC configs right away |
1080 | * this isn't strictly according to the RNDIS spec | 1080 | * this isn't strictly according to the RNDIS spec |
1081 | */ | 1081 | */ |
1082 | if (!cdc_active (dev)) { | 1082 | else if (!cdc_active (dev)) { |
1083 | netif_carrier_on (dev->net); | 1083 | netif_carrier_on (dev->net); |
1084 | if (netif_running (dev->net)) { | 1084 | if (netif_running (dev->net)) { |
1085 | spin_unlock (&dev->lock); | 1085 | spin_unlock (&dev->lock); |