Commit 4d9db977f9ac9b15f916888978026025c6cf9563

Authored by Julia Lawall
Committed by Greg Kroah-Hartman
1 parent bb59a4c539

staging: Use available error codes

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>

Showing 3 changed files with 3 additions and 3 deletions Side-by-side Diff

drivers/staging/lirc/lirc_sasem.c
... ... @@ -512,7 +512,7 @@
512 512 mutex_unlock(&context->ctx_lock);
513 513  
514 514 mutex_unlock(&disconnect_lock);
515   - return 0;
  515 + return retval;
516 516 }
517 517  
518 518 /**
drivers/staging/vt6655/iwctl.c
... ... @@ -1900,7 +1900,7 @@
1900 1900 }
1901 1901  
1902 1902 out://not completely ...not necessary in wpa_supplicant 0.5.8
1903   - return 0;
  1903 + return ret;
1904 1904 }
1905 1905  
1906 1906 int iwctl_giwgenie(struct net_device *dev,
drivers/staging/vt6656/iwctl.c
... ... @@ -1719,7 +1719,7 @@
1719 1719 }
1720 1720  
1721 1721 out://not completely ...not necessary in wpa_supplicant 0.5.8
1722   - return 0;
  1722 + return ret;
1723 1723 }
1724 1724  
1725 1725 int iwctl_giwgenie(struct net_device *dev,