lkml.org 
[lkml]   [2006]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[2.6 patch] 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 <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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-10 23:28    [W:0.035 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site