]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
staging: Use available error codes
authorJulia Lawall <julia@diku.dk>
Mon, 16 Aug 2010 16:26:36 +0000 (18:26 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 31 Aug 2010 22:05:12 +0000 (15:05 -0700)
An error code is stored in a variable, but 0 is returned instead.  Use the
variable instead of 0.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
local idexpression x;
constant C;
@@

if (...) { ...
  x = -C
  ... when != x
(
  return <+...x...+>;
|
  return NULL;
|
  return;
|
* return ...;
)
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/lirc/lirc_sasem.c
drivers/staging/vt6655/iwctl.c
drivers/staging/vt6656/iwctl.c

index 73166c3f581fd3ed8b7ef805fd27613212817c43..856487eecd247896586a554ea58261a87a86490c 100644 (file)
@@ -512,7 +512,7 @@ exit:
        mutex_unlock(&context->ctx_lock);
 
        mutex_unlock(&disconnect_lock);
-       return 0;
+       return retval;
 }
 
 /**
index 43227617aabe676886d1e74d80da6a41757f2e56..4009c0b5bb272bc5e32c7a654eba213c037d0c0e 100644 (file)
@@ -1900,7 +1900,7 @@ int iwctl_siwgenie(struct net_device *dev,
        }
 
        out://not completely ...not necessary in wpa_supplicant 0.5.8
-       return 0;
+       return ret;
 }
 
 int iwctl_giwgenie(struct net_device *dev,
index 9c855f0ffced4acfed54e0871796db550232a59c..0004be8e3957bb96c9c69f56a7109d818c6660f4 100644 (file)
@@ -1719,7 +1719,7 @@ int iwctl_siwgenie(struct net_device *dev,
        }
 
        out://not completely ...not necessary in wpa_supplicant 0.5.8
-       return 0;
+       return ret;
 }
 
 int iwctl_giwgenie(struct net_device *dev,