[2.6 patch] ivtv: fix NULL dereference

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Adrian Bunk
Date: Sunday, October 14, 2007 - 10:51 am

We shouldn't dereference "itv" when we know it's NULL...

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
--- linux-2.6/drivers/media/video/ivtv/ivtv-fileops.c.old	2007-10-14 19:17:12.000000000 +0200
+++ linux-2.6/drivers/media/video/ivtv/ivtv-fileops.c	2007-10-14 19:18:05.000000000 +0200
@@ -947,7 +947,7 @@ int ivtv_v4l2_open(struct inode *inode, 
 	if (itv == NULL) {
 		/* Couldn't find a device registered
 		   on that minor, shouldn't happen! */
-		IVTV_WARN("No ivtv device found on minor %d\n", minor);
+		printk(KERN_WARNING "No ivtv device found on minor %d\n", minor);
 		return -ENXIO;
 	}
 

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[2.6 patch] ivtv: fix NULL dereference, Adrian Bunk, (Sun Oct 14, 10:51 am)
Re: [2.6 patch] ivtv: fix NULL dereference, Hans Verkuil, (Sun Oct 14, 11:03 am)
Re: [2.6 patch] ivtv: fix NULL dereference, Mauro Carvalho Chehab, (Mon Oct 15, 11:01 am)