summaryrefslogtreecommitdiff
path: root/drivers/staging/vt6655
diff options
context:
space:
mode:
authorJi-Hun Kim <ji_hun.kim@samsung.com>2018-04-05 16:09:20 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-23 15:23:36 +0200
commit1dc751a5b51d730a98b528672f91d7a38aca5123 (patch)
tree5cae888908e519965a104131eb3415609de49230 /drivers/staging/vt6655
parent5341ee0adb17d12a96dc5344e0d267cd12b52135 (diff)
staging: vt6655: add handling memory leak on vnt_start()
There was no code for handling memory leaks of device_init_rings() and request_irq(). It needs to free allocated memory in the device_init_rings() , when request_irq() would be failed. Add freeing sequences of irq and device init rings. Signed-off-by: Ji-Hun Kim <ji_hun.kim@samsung.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6655')
-rw-r--r--drivers/staging/vt6655/device_main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 700c03c52f70..1ab0e8562d40 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1237,13 +1237,13 @@ static int vnt_start(struct ieee80211_hw *hw)
IRQF_SHARED, "vt6655", priv);
if (ret) {
dev_dbg(&priv->pcid->dev, "failed to start irq\n");
- return ret;
+ goto err_free_rings;
}
dev_dbg(&priv->pcid->dev, "call device init rd0 ring\n");
ret = device_init_rd0_ring(priv);
if (ret)
- return ret;
+ goto err_free_irq;
ret = device_init_rd1_ring(priv);
if (ret)
goto err_free_rd0_ring;
@@ -1269,6 +1269,10 @@ err_free_rd1_ring:
device_free_rd1_ring(priv);
err_free_rd0_ring:
device_free_rd0_ring(priv);
+err_free_irq:
+ free_irq(priv->pcid->irq, priv);
+err_free_rings:
+ device_free_rings(priv);
return ret;
}