Commit 8bca81d9 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by David S. Miller

usbnet: smsc95xx: dereferencing NULL pointer

we were dereferencing dev to initialize pdata. but just after that we
have a BUG_ON(!dev). so we were basically dereferencing the pointer
first and then tesing it for NULL.
Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d65c4e4e
...@@ -1670,12 +1670,14 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) ...@@ -1670,12 +1670,14 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
static int smsc95xx_resume(struct usb_interface *intf) static int smsc95xx_resume(struct usb_interface *intf)
{ {
struct usbnet *dev = usb_get_intfdata(intf); struct usbnet *dev = usb_get_intfdata(intf);
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata;
u8 suspend_flags = pdata->suspend_flags; u8 suspend_flags;
int ret; int ret;
u32 val; u32 val;
BUG_ON(!dev); BUG_ON(!dev);
pdata = (struct smsc95xx_priv *)(dev->data[0]);
suspend_flags = pdata->suspend_flags;
netdev_dbg(dev->net, "resume suspend_flags=0x%02x\n", suspend_flags); netdev_dbg(dev->net, "resume suspend_flags=0x%02x\n", suspend_flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment