Skip to contentSkip to conversation

USB iowarrior.c: fix check-after-use

PATCH In review Adrian Bunk 2 participants 2 messages Oct 18, 2007 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
82a9906788e8bedc6d5adc54046e1713e4a399df

drivers/usb/misc/iowarrior.c +1 -1
index 46d9f27..9930b0a 100644
@@ -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;
 	}
#1 lore raw

Am Donnerstag 18 Oktober 2007 schrieb Adrian Bunk:

Quoted 5 lines

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.

Looking good.

Regards
Oliver