Re: [PATCH] cdc_ncm: do not call usbnet_link_change from cdc_ncm_bind
From: David Miller <hidden>
Date: 2016-03-07 20:58:37
From: Bjørn Mork <redacted> Date: Mon, 7 Mar 2016 21:15:36 +0100
usbnet_link_change will call schedule_work and should be
avoided if bind is failing. Otherwise we will end up with
scheduled work referring to a netdev which has gone away.
Instead of making the call conditional, we can just defer
it to usbnet_probe, using the driver_info flag made for
this purpose.
Fixes: 8a34b0ae8778 ("usbnet: cdc_ncm: apply usbnet_link_change")
Reported-by: Andrey Konovalov <redacted>
Suggested-by: Linus Torvalds <torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Signed-off-by: Bjørn Mork <redacted>...
Even with Oliver's generic fix we should still fix the inconsistency in cdc_ncm, as pointed out by Linus. This is a slightly different approach than the patch proposed by Linus. When I started looking at this I couldn't figure out why we were doing this differently in this driver from all the other usbnet drivers disabling the link at probe time. So let's make it consistent. Then at least we get consistent bugs :)
Fair enough, applied and queued up for -stable. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html