[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100305.074335.248610315.davem@davemloft.net>
Date: Fri, 05 Mar 2010 07:43:35 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: Steve.Glendinning@...c.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] Fix netdev_printk null dereference
From: Steve.Glendinning@...c.com
Date: Fri, 5 Mar 2010 15:29:41 +0000
> The failure I'm seeing is caused when the usb device is disconnected.
> smsc95xx detects that a pending USB control operation failed
> and tries to print a message via netdev_printk to report this.
>
> Unfortunately, something else (the USB subsystem?) has already set
> parent to null at this time so the netdev_printk causes a null
> dereference.
>
> So netdev_printk suddenly changes from safe to use to unsafe to use?
It seems to me that really you only need this parent NULL check where
you notice the USB control operation failed and want to print a
message about that.
That should cover all the necessary cases shouldn't it?
Even more importantly, why does a USB disconnect NULL out the netdev
parent device pointer? Until you actually release this USB device in
the driver, the parent pointer should stay there.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists