From: Huzaifa Sidhpurwala Date: Mon, 9 May 2011 10:32:24 +0000 (-0300) Subject: [media] Prevent null pointer derefernce of pdev X-Git-Tag: firefly_0821_release~7613^2~1037^2~50 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cecc2471ea719a359b253449781a584e319d8909;p=firefly-linux-kernel-4.4.55.git [media] Prevent null pointer derefernce of pdev Make sure pdev is not dereferenced when it is null Signed-off-by: Huzaifa Sidhpurwala Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c index 780af5f81642..356cd42b593b 100644 --- a/drivers/media/video/pwc/pwc-if.c +++ b/drivers/media/video/pwc/pwc-if.c @@ -1850,7 +1850,6 @@ static void usb_pwc_disconnect(struct usb_interface *intf) } else { /* Device is closed, so we can safely unregister it */ PWC_DEBUG_PROBE("Unregistering video device in disconnect().\n"); - pwc_cleanup(pdev); disconnect_out: /* search device_hint[] table if we occupy a slot, by any chance */ @@ -1860,6 +1859,7 @@ disconnect_out: } mutex_unlock(&pdev->modlock); + pwc_cleanup(pdev); }