From ac082bc52dd197ee7fbc1271f17cea63615b239f Mon Sep 17 00:00:00 2001 From: Rickard Strandqvist Date: Tue, 20 May 2014 23:34:25 +0200 Subject: [PATCH] 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: Rickard Strandqvist Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/usb_intf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c index bbd5888e316b..ba743542babc 100644 --- a/drivers/staging/rtl8712/usb_intf.c +++ b/drivers/staging/rtl8712/usb_intf.c @@ -595,7 +595,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf, error: usb_put_dev(udev); usb_set_intfdata(pusb_intf, NULL); - if (padapter->dvobj_deinit != NULL) + if (padapter && padapter->dvobj_deinit != NULL) padapter->dvobj_deinit(padapter); if (pnetdev) free_netdev(pnetdev); -- 2.34.1