usbnet: clear OPEN flag in failure path

Without clearing OPEN flag in failure path, runtime or system resume
may submit interrupt/rx URB and start tx queue mistakenly on a
interface in DOWN state.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Ming Lei 2012-06-19 21:15:51 +00:00 committed by David S. Miller
parent b9f90eb274
commit fb13c47b8e

View File

@ -796,11 +796,13 @@ int usbnet_open (struct net_device *net)
if (info->manage_power) {
retval = info->manage_power(dev, 1);
if (retval < 0)
goto done;
goto done_manage_power_error;
usb_autopm_put_interface(dev->intf);
}
return retval;
done_manage_power_error:
clear_bit(EVENT_DEV_OPEN, &dev->flags);
done:
usb_autopm_put_interface(dev->intf);
done_nopm: