Skip to content

Commit

Permalink
USB: gadget: ethernet error path potential oops fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Feb 1, 2008
1 parent 340ba5f commit e7b13ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/usb/gadget/ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,19 +1067,19 @@ set_ether_config (struct eth_dev *dev, gfp_t gfp_flags)

/* 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);
(void) usb_ep_disable (dev->out_ep);
dev->in = NULL;
dev->out = NULL;
} else
}

/* activate non-CDC configs right away
* this isn't strictly according to the RNDIS spec
*/
if (!cdc_active (dev)) {
else if (!cdc_active (dev)) {
netif_carrier_on (dev->net);
if (netif_running (dev->net)) {
spin_unlock (&dev->lock);
Expand Down

0 comments on commit e7b13ec

Please sign in to comment.