summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristian Engelmayer <cengelma@gmx.at>2014-04-10 20:37:53 +0200
committerJohn W. Linville <linville@tuxdriver.com>2014-04-14 20:31:42 +0200
commit61698b7e222c33e1d38996519b38dd34cbcb8634 (patch)
treee98744016396a3cefa2e87d7719cf33d5659b23d /drivers
parentcw1200: Fix cw1200_debug_link_id (diff)
downloadlinux-61698b7e222c33e1d38996519b38dd34cbcb8634.tar.xz
linux-61698b7e222c33e1d38996519b38dd34cbcb8634.zip
rsi: Fix a potential memory leak in rsi_send_auto_rate_request()
Fix a potential memory leak in the error path of function rsi_send_auto_rate_request(). In case memory allocation for array 'selected_rates' fails, the error path exits and leaves the previously allocated skb in place. Detected by Coverity: CID 1195575. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_mgmt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
index 3a030b9d0fe6..1b28cda6ca88 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
@@ -966,6 +966,7 @@ static int rsi_send_auto_rate_request(struct rsi_common *common)
if (!selected_rates) {
rsi_dbg(ERR_ZONE, "%s: Failed in allocation of mem\n",
__func__);
+ dev_kfree_skb(skb);
return -ENOMEM;
}