summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2018-06-28 08:08:09 -0500
committerKalle Valo <kvalo@codeaurora.org>2018-07-04 18:14:09 +0300
commit04614fe46f315a223d96b8f5df7b52130965677b (patch)
treeb68194ce2c8b1e08e5dee955cd968fb95b025297 /drivers/net/wireless/ti
parent7444a8092906ed44c09459780c56ba57043e39b1 (diff)
downloadblackbird-op-linux-04614fe46f315a223d96b8f5df7b52130965677b.tar.gz
blackbird-op-linux-04614fe46f315a223d96b8f5df7b52130965677b.zip
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: 4ec7cece87b3 ("wlcore: Add missing PM call for wlcore_cmd_wait_for_event_or_timeout()") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ti')
-rw-r--r--drivers/net/wireless/ti/wlcore/cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
index 836c61663803..903968735a74 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.c
+++ b/drivers/net/wireless/ti/wlcore/cmd.c
@@ -195,8 +195,7 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl,
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
-
- return ret;
+ goto free_vector;
}
do {
@@ -232,6 +231,7 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl,
out:
pm_runtime_mark_last_busy(wl->dev);
pm_runtime_put_autosuspend(wl->dev);
+free_vector:
kfree(events_vector);
return ret;
}
OpenPOWER on IntegriCloud