Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] Prevent null pointer derefernce of pdev

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>

authored by

Huzaifa Sidhpurwala and committed by
Mauro Carvalho Chehab
cecc2471 bbe880b4

+1 -1
+1 -1
drivers/media/video/pwc/pwc-if.c
··· 1850 1850 } else { 1851 1851 /* Device is closed, so we can safely unregister it */ 1852 1852 PWC_DEBUG_PROBE("Unregistering video device in disconnect().\n"); 1853 - pwc_cleanup(pdev); 1854 1853 1855 1854 disconnect_out: 1856 1855 /* search device_hint[] table if we occupy a slot, by any chance */ ··· 1859 1860 } 1860 1861 1861 1862 mutex_unlock(&pdev->modlock); 1863 + pwc_cleanup(pdev); 1862 1864 } 1863 1865 1864 1866