From: Kulikov Vasiliy Date: Fri, 30 Jul 2010 11:09:02 +0000 (+0400) Subject: staging: rtl8192su: check whether requests succeeded X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0ebdd466f4682608a6b90ef018d36b57925f4d64;p=linux-beck.git staging: rtl8192su: check whether requests succeeded rtl8192_usb_probe() does not check alloc_ieee80211() and register_netdev() return values for errors. Signed-off-by: Kulikov Vasiliy Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8192su/r8192U_core.c b/drivers/staging/rtl8192su/r8192U_core.c index 90ab1aa5f8a0..fcd05304b470 100644 --- a/drivers/staging/rtl8192su/r8192U_core.c +++ b/drivers/staging/rtl8192su/r8192U_core.c @@ -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); @@ -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);