Commit ac082bc5 authored by Rickard Strandqvist's avatar Rickard Strandqvist Committed by Greg Kroah-Hartman

staging: rtl8712: usb_intf.c: Fix for possible null pointer dereference

There is otherwise a risk of a possible null pointer dereference.

Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: default avatarRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 265b8e5f
...@@ -595,7 +595,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf, ...@@ -595,7 +595,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
error: error:
usb_put_dev(udev); usb_put_dev(udev);
usb_set_intfdata(pusb_intf, NULL); usb_set_intfdata(pusb_intf, NULL);
if (padapter->dvobj_deinit != NULL) if (padapter && padapter->dvobj_deinit != NULL)
padapter->dvobj_deinit(padapter); padapter->dvobj_deinit(padapter);
if (pnetdev) if (pnetdev)
free_netdev(pnetdev); free_netdev(pnetdev);
......
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