lkml.org 
[lkml]   [2007]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[2.6 patch] USB iowarrior.c: fix check-after-use
The Coverity checker spotted that we have already oops'ed if "dev"
was NULL.

Since "dev" being NULL doesn't seem to be possible here this patch
removes the NULL check.

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

---
82a9906788e8bedc6d5adc54046e1713e4a399df
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 46d9f27..9930b0a 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -351,7 +351,7 @@ static ssize_t iowarrior_write(struct file *file,

mutex_lock(&dev->mutex);
/* verify that the device wasn't unplugged */
- if (dev == NULL || !dev->present) {
+ if (!dev->present) {
retval = -ENODEV;
goto exit;
}
-
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: 2007-10-18 12:55    [W:0.036 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site