From: Xiangyang Zhang <xyz.sun.ok@gmail.com>
To: gregkh@linuxfoundation.org
Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
xyz.sun.ok@gmail.com
Subject: [PATCH] staging: r8188eu: Fix a resource leak in update_bcn_wps_ie
Date: Sat, 21 Aug 2021 16:18:24 +0800 [thread overview]
Message-ID: <20210821081824.14745-1-xyz.sun.ok@gmail.com> (raw)
The "pbackup_remainder_ie" variable is not freed when "pwps_ie_src" is null
Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Signed-off-by: Xiangyang Zhang <xyz.sun.ok@gmail.com>
---
drivers/staging/r8188eu/core/rtw_ap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/r8188eu/core/rtw_ap.c b/drivers/staging/r8188eu/core/rtw_ap.c
index 1127e9a52458..2ce982390c7b 100644
--- a/drivers/staging/r8188eu/core/rtw_ap.c
+++ b/drivers/staging/r8188eu/core/rtw_ap.c
@@ -1300,7 +1300,7 @@ static void update_bcn_wps_ie(struct adapter *padapter)
pwps_ie_src = pmlmepriv->wps_beacon_ie;
if (!pwps_ie_src)
- return;
+ goto exit;
wps_ielen = (uint)pwps_ie_src[1];/* to get ie data len */
if ((wps_offset + wps_ielen + 2 + remainder_ielen) <= MAX_IE_SZ) {
@@ -1314,6 +1314,7 @@ static void update_bcn_wps_ie(struct adapter *padapter)
pnetwork->IELength = wps_offset + (wps_ielen + 2) + remainder_ielen;
}
+exit:
kfree(pbackup_remainder_ie);
}
--
2.19.1
next reply other threads:[~2021-08-21 8:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-21 8:18 Xiangyang Zhang [this message]
2021-08-21 8:41 ` Michael Straube
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210821081824.14745-1-xyz.sun.ok@gmail.com \
--to=xyz.sun.ok@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=phil@philpotter.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®