Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cecc2471 authored by Huzaifa Sidhpurwala's avatar Huzaifa Sidhpurwala Committed by Mauro Carvalho Chehab
Browse files

[media] Prevent null pointer derefernce of pdev



Make sure pdev is not dereferenced when it is null

Signed-off-by: default avatarHuzaifa Sidhpurwala <huzaifas@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent bbe880b4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
}