drivers/usb/media/vicam.c: fix a NULL pointer dereference
PATCH 1/1 drivers/usb/media/vicam.c: fix a NULL pointer dereference
This patch fixes a NULL pointer dereference spotted by the Coverity checker.
Signed-off-by Adrian Bunk <[email protected]>
drivers/usb/media/vicam.c renamed from drivers/usb/media/vicam.c.old +1 -0
@@ -758,18 +758,19 @@ vicam_open(struct inode *inode, struct f {struct video_device *dev =video_devdata (file);struct vicam_camera *cam = (struct vicam_camera *) dev->priv;DBG ("open\n" );if (!cam) {printk (KERN_ERR "vicam video_device improperly initialized" ); +return -EINVAL ; }/* the videodev_lock held above us protects us from * simultaneous opens...for now. we probably shouldn't * rely on this fact forever. */ if (cam->open_count >0 ) { printk(KERN_INFO