All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] drivers/usb/media/vicam.c: fix a NULL pointer dereference
@ 2006-03-10 22:25 Adrian Bunk
  0 siblings, 0 replies; only message in thread
From: Adrian Bunk @ 2006-03-10 22:25 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb-devel, linux-kernel

This patch fixes a NULL pointer dereference spotted by the Coverity 
checker.


Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.16-rc5-mm3-full/drivers/usb/media/vicam.c.old	2006-03-10 20:54:17.000000000 +0100
+++ linux-2.6.16-rc5-mm3-full/drivers/usb/media/vicam.c	2006-03-10 20:54:44.000000000 +0100
@@ -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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-10 22:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-10 22:25 [2.6 patch] drivers/usb/media/vicam.c: fix a NULL pointer dereference Adrian Bunk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.