Skip to content

Commit

Permalink
staging: r8712u: Remove needless test for NULL
Browse files Browse the repository at this point in the history
In commit ee6aeff, a swatch warning was fixed by moving some code inside
an if block that is executed only when the pointer padapter is not NULL.
In fact, padapter can never be NULL and the corect fix should have been
the removal of the test of padapter.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Larry Finger authored and Greg Kroah-Hartman committed May 14, 2012
1 parent 5d4172c commit 1d73fad
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions drivers/staging/rtl8712/usb_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,25 +621,23 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
struct usb_device *udev = interface_to_usbdev(pusb_intf);

usb_set_intfdata(pusb_intf, NULL);
if (padapter) {
if (padapter->fw_found)
release_firmware(padapter->fw);
/* never exit with a firmware callback pending */
wait_for_completion(&padapter->rtl8712_fw_ready);
if (drvpriv.drv_registered == true)
padapter->bSurpriseRemoved = true;
if (pnetdev != NULL) {
/* will call netdev_close() */
unregister_netdev(pnetdev);
}
flush_scheduled_work();
udelay(1);
/*Stop driver mlme relation timer */
if (padapter->fw_found)
r8712_stop_drv_timers(padapter);
r871x_dev_unload(padapter);
r8712_free_drv_sw(padapter);
if (padapter->fw_found)
release_firmware(padapter->fw);
/* never exit with a firmware callback pending */
wait_for_completion(&padapter->rtl8712_fw_ready);
if (drvpriv.drv_registered == true)
padapter->bSurpriseRemoved = true;
if (pnetdev != NULL) {
/* will call netdev_close() */
unregister_netdev(pnetdev);
}
flush_scheduled_work();
udelay(1);
/*Stop driver mlme relation timer */
if (padapter->fw_found)
r8712_stop_drv_timers(padapter);
r871x_dev_unload(padapter);
r8712_free_drv_sw(padapter);
usb_set_intfdata(pusb_intf, NULL);
/* decrease the reference count of the usb device structure
* when disconnect */
Expand Down

0 comments on commit 1d73fad

Please sign in to comment.