[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <ee783fbb71abb549505b84542223be7a7c905eea.1630692375.git.paskripkin@gmail.com>
Date: Fri, 3 Sep 2021 21:17:52 +0300
From: Pavel Skripkin <paskripkin@...il.com>
To: Larry.Finger@...inger.net, phil@...lpotter.co.uk,
gregkh@...uxfoundation.org, straube.linux@...il.com,
fmdefrancesco@...il.com
Cc: linux-kernel@...r.kernel.org, linux-staging@...ts.linux.dev,
Pavel Skripkin <paskripkin@...il.com>
Subject: [PATCH 1/2] staging: r8188eu: fix memory leak in rtw_set_key
Before returning with an error we should free allocated buffers, since
they are not assigned to anywhere.
Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Signed-off-by: Pavel Skripkin <paskripkin@...il.com>
---
drivers/staging/r8188eu/core/rtw_mlme.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
index 1115ff5d865a..bd991d7ed809 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme.c
@@ -1722,6 +1722,8 @@ int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, in
psetkeyparm->grpkey = 1;
break;
default:
+ kfree(psetkeyparm);
+ kfree(pcmd);
res = _FAIL;
goto exit;
}
--
2.33.0
Powered by blists - more mailing lists