summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/wl1251/cmd.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2011-08-08 15:18:03 +0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-10 22:07:10 +0400
commit059c4383550b158bc1b6d34d8ab085e81cb3d71b (patch)
tree903a3b657555ae78c576150f054a2e143ea539b6 /drivers/net/wireless/wl1251/cmd.c
parentbdc71bc59231f5542af13b5061b9ab124d093050 (diff)
downloadlinux-059c4383550b158bc1b6d34d8ab085e81cb3d71b.tar.xz
drivers/net/wireless/wl1251: add missing kfree
In each case, the kfree already at the end of the function is also needed in the error case. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @exists@ local idexpression x; statement S,S1; expression E; identifier fl; expression *ptr != NULL; @@ x = \(kmalloc\|kzalloc\|kcalloc\)(...); ... if (x == NULL) S <... when != x when != if (...) { <+...kfree(x)...+> } when any when != true x == NULL x->fl ...> ( if (x == NULL) S1 | if (...) { ... when != x when forall ( return \(0\|<+...x...+>\|ptr\); | * return ...; ) } ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl1251/cmd.c')
-rw-r--r--drivers/net/wireless/wl1251/cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/wl1251/cmd.c b/drivers/net/wireless/wl1251/cmd.c
index 81f164bc4888..d14d69d733a0 100644
--- a/drivers/net/wireless/wl1251/cmd.c
+++ b/drivers/net/wireless/wl1251/cmd.c
@@ -241,7 +241,7 @@ int wl1251_cmd_data_path(struct wl1251 *wl, u8 channel, bool enable)
if (ret < 0) {
wl1251_error("tx %s cmd for channel %d failed",
enable ? "start" : "stop", channel);
- return ret;
+ goto out;
}
wl1251_debug(DEBUG_BOOT, "tx %s cmd channel %d",