提交 4104863f 编写于 作者: J Julia Lawall 提交者: John W. Linville

b43legacy: Release mutex in error handling code

The mutex is released on a successful return, so it would seem that it
should be released on an error return as well.

The semantic patch finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression l;
@@

mutex_lock(l);
... when != mutex_unlock(l)
    when any
    when strict
(
if (...) { ... when != mutex_unlock(l)
+   mutex_unlock(l);
    return ...;
}
|
mutex_unlock(l);
)
// </smpl>
Signed-off-by: NJulia Lawall <julia@diku.dk>
Signed-off-by: NMichael Buesch <mb@bu3sch.de>
Cc: stable <stable@kernel.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 80c42aff
......@@ -3845,10 +3845,10 @@ static int b43legacy_resume(struct ssb_device *dev)
goto out;
}
}
mutex_unlock(&wl->mutex);
b43legacydbg(wl, "Device resumed.\n");
out:
mutex_unlock(&wl->mutex);
return err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册