Skip to content

Commit

Permalink
[media] Prevent null pointer derefernce of pdev
Browse files Browse the repository at this point in the history
Make sure pdev is not dereferenced when it is null

Signed-off-by: Huzaifa Sidhpurwala <huzaifas@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Huzaifa Sidhpurwala authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent bbe880b commit cecc247
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/pwc/pwc-if.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -1860,6 +1859,7 @@ static void usb_pwc_disconnect(struct usb_interface *intf)
}

mutex_unlock(&pdev->modlock);
pwc_cleanup(pdev);
}


Expand Down

0 comments on commit cecc247

Please sign in to comment.