]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Staging: bcm: remove unneeded NULL check
authorDan Carpenter <error27@gmail.com>
Fri, 8 Oct 2010 12:57:44 +0000 (14:57 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 8 Oct 2010 14:29:56 +0000 (07:29 -0700)
The error handling here is wrong.  If psIntfAdapter were NULL then we
would have a NULL dereference in the debug output on the error path.
But this function is only called from usbbcm_device_probe() when
psIntfAdapter is non-NULL.

Since the check isn't needed and I removed it instead of fixing it.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/bcm/InterfaceInit.c

index 81523b1e4f0868ffc48c7e13b8672c516cab80ff..824f9a45007aa8aebf65852ffb172e69eae95981 100644 (file)
@@ -529,11 +529,6 @@ INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter)
        BOOLEAN bBcm16 = FALSE;
        UINT uiData = 0;
 
-       if(psIntfAdapter == NULL)
-       {
-               BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Interface Adapter is NULL");
-               return -EINVAL;
-       }
        /* Store the usb dev into interface adapter */
        psIntfAdapter->udev = usb_get_dev(interface_to_usbdev(
                                                                psIntfAdapter->interface));