Skip to content

Commit

Permalink
staging: rtl8192su: check whether requests succeeded
Browse files Browse the repository at this point in the history
rtl8192_usb_probe() does not check alloc_ieee80211() and
register_netdev() return values for errors.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Kulikov Vasiliy authored and Greg Kroah-Hartman committed Aug 3, 2010
1 parent 10f3f5b commit 0ebdd46
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/staging/rtl8192su/r8192U_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -7380,6 +7380,8 @@ static int __devinit rtl8192_usb_probe(struct usb_interface *intf,
RT_TRACE(COMP_INIT, "Oops: i'm coming\n");

dev = alloc_ieee80211(sizeof(struct r8192_priv));
if (dev == NULL)
return -ENOMEM;

usb_set_intfdata(intf, dev);
SET_NETDEV_DEV(dev, &intf->dev);
Expand Down Expand Up @@ -7417,7 +7419,8 @@ static int __devinit rtl8192_usb_probe(struct usb_interface *intf,
netif_carrier_off(dev);
netif_stop_queue(dev);

register_netdev(dev);
if (register_netdev(dev))
goto fail;
RT_TRACE(COMP_INIT, "dev name=======> %s\n",dev->name);
rtl8192_proc_init_one(dev);

Expand Down

0 comments on commit 0ebdd46

Please sign in to comment.