From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= Subject: Re: [PATCH net] net: qmi_wwan: fix Oops while disconnecting Date: Thu, 28 Jun 2012 10:36:49 +0200 Message-ID: <87lij7de8u.fsf@nemi.mork.no> References: <1340356279-3124-1-git-send-email-bjorn@mork.no> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Oliver Neukum , Ming Lei , linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Marius =?utf-8?Q?Bj?= =?utf-8?Q?=C3=B8rnstad?= Kotsbak To: David Miller Return-path: In-Reply-To: <1340356279-3124-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org> (=?utf-8?Q?=22Bj=C3=B8rn?= Mork"'s message of "Fri, 22 Jun 2012 11:11:18 +0200") Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org Bj=C3=B8rn Mork writes: [..] > Fixes this Oops where a cdc-wdm device was closed while the > USB device was disconnecting, causing wdm_release to call > qmi_wwan_cdc_wdm_manage_power after intfdata was set to > NULL by usbnet_disconnect: > > [41819.087460] BUG: unable to handle kernel NULL pointer dereference = at 00000080 > [41819.087815] IP: [] qmi_wwan_manage_power+0x68/0x90 [qmi_= wwan] > [41819.088028] *pdpt =3D 000000000314f001 *pde =3D 0000000000000000 > [41819.088028] Oops: 0002 [#1] SMP [..] > diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c > index 3767a12..b01960f 100644 > --- a/drivers/net/usb/qmi_wwan.c > +++ b/drivers/net/usb/qmi_wwan.c > @@ -197,6 +197,10 @@ err: > static int qmi_wwan_cdc_wdm_manage_power(struct usb_interface *intf,= int on) > { > struct usbnet *dev =3D usb_get_intfdata(intf); > + > + /* can be called while disconnecting */ > + if (!dev) > + return 0; > return qmi_wwan_manage_power(dev, on); > } Hello, I'd like this patch applied to qmi_wwan regardless of the outcome of th= e (now stalled?) generic usbnet_disconnect discussion. The patch fixes a real Oops in 3.4 and 3.5, and I believe it should be left in qmi_wwan even if the usbnet code is fixed to avoid this specifi= c bug. The additional NULL test won't harm, and it makes the code more robust should someone decide to rearrange usbnet_disconnect again at some later point in time. I really want this fixed in the next 3.4 stable release, if possible. Should I resubmit the patch, or will you pick it up from http://patchwork.ozlabs.org/patch/166542/ ? Thanks, Bj=C3=B8rn -- 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