Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3328d9752f3796a5f5f8695d27a175c34407a5ed
Commit:     3328d9752f3796a5f5f8695d27a175c34407a5ed
Parent:     e28c6a77061ab28bd2f0b57e400e3e58cd3474ca
Author:     Adrian Bunk <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 18 12:53:07 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Oct 25 12:18:43 2007 -0700

    USB rio500.c: fix check-after-use
    
    The Coverity checker spotted that we have already oops'ed if "dev"
    was NULL in these places.
    
    Since "dev" being NULL isn't possible at these places this patch removes
    the NULL checks.
    
    Additionally, I've fixed the formatting of the if's.
    
    Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
    Acked-by: Oliver Neukum <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/misc/rio500.c |   15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c
index 88f6abe..330c18e 100644
--- a/drivers/usb/misc/rio500.c
+++ b/drivers/usb/misc/rio500.c
@@ -118,10 +118,7 @@ ioctl_rio(struct inode *inode, struct file *file, unsigned 
int cmd,
 
        mutex_lock(&(rio->lock));
         /* Sanity check to make sure rio is connected, powered, etc */
-        if ( rio == NULL ||
-             rio->present == 0 ||
-             rio->rio_dev == NULL )
-       {
+        if (rio->present == 0 || rio->rio_dev == NULL) {
                retval = -ENODEV;
                goto err_out;
        }
@@ -280,10 +277,7 @@ write_rio(struct file *file, const char __user *buffer,
        if (intr)
                return -EINTR;
         /* Sanity check to make sure rio is connected, powered, etc */
-        if ( rio == NULL ||
-             rio->present == 0 ||
-             rio->rio_dev == NULL )
-       {
+        if (rio->present == 0 || rio->rio_dev == NULL) {
                mutex_unlock(&(rio->lock));
                return -ENODEV;
        }
@@ -369,10 +363,7 @@ read_rio(struct file *file, char __user *buffer, size_t 
count, loff_t * ppos)
        if (intr)
                return -EINTR;
        /* Sanity check to make sure rio is connected, powered, etc */
-        if ( rio == NULL ||
-             rio->present == 0 ||
-             rio->rio_dev == NULL )
-       {
+        if (rio->present == 0 || rio->rio_dev == NULL) {
                mutex_unlock(&(rio->lock));
                return -ENODEV;
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to