From: Adrian Bunk <bunk@kernel.org>
To: greg@kroah.com
Cc: linux-usb-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [2.6 patch] USB iowarrior.c: fix check-after-use
Date: Thu, 18 Oct 2007 12:52:50 +0200 [thread overview]
Message-ID: <20071018105250.GM3778@stusta.de> (raw)
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;
}
next reply other threads:[~2007-10-18 10:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-18 10:52 Adrian Bunk [this message]
2007-10-18 11:01 ` [linux-usb-devel] [2.6 patch] USB iowarrior.c: fix check-after-use Oliver Neukum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071018105250.GM3778@stusta.de \
--to=bunk@kernel.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox