提交 04614fe4 编写于 作者: G Gustavo A. R. Silva 提交者: Kalle Valo

wlcore: Fix memory leak in wlcore_cmd_wait_for_event_or_timeout

In case memory resources for *events_vector* were allocated, release
them before return.

Addresses-Coverity-ID: 1470194 ("Resource leak")
Fixes: 4ec7cece ("wlcore: Add missing PM call for wlcore_cmd_wait_for_event_or_timeout()")
Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: NTony Lindgren <tony@atomide.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 7444a809
...@@ -195,8 +195,7 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl, ...@@ -195,8 +195,7 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl,
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) { if (ret < 0) {
pm_runtime_put_noidle(wl->dev); pm_runtime_put_noidle(wl->dev);
goto free_vector;
return ret;
} }
do { do {
...@@ -232,6 +231,7 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl, ...@@ -232,6 +231,7 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl,
out: out:
pm_runtime_mark_last_busy(wl->dev); pm_runtime_mark_last_busy(wl->dev);
pm_runtime_put_autosuspend(wl->dev); pm_runtime_put_autosuspend(wl->dev);
free_vector:
kfree(events_vector); kfree(events_vector);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册