mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
staging: r8188eu: Fix a resource leak in update_bcn_wps_ie
The "pbackup_remainder_ie" variable is not freed when "pwps_ie_src" is null
Fixes: 15865124fe
("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Xiangyang Zhang <xyz.sun.ok@gmail.com>
Link: https://lore.kernel.org/r/20210821081824.14745-1-xyz.sun.ok@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5598e47a79
commit
2d29f81ce8
1 changed files with 2 additions and 1 deletions
|
@ -1199,7 +1199,7 @@ static void update_bcn_wps_ie(struct adapter *padapter)
|
||||||
|
|
||||||
pwps_ie_src = pmlmepriv->wps_beacon_ie;
|
pwps_ie_src = pmlmepriv->wps_beacon_ie;
|
||||||
if (!pwps_ie_src)
|
if (!pwps_ie_src)
|
||||||
return;
|
goto exit;
|
||||||
|
|
||||||
wps_ielen = (uint)pwps_ie_src[1];/* to get ie data len */
|
wps_ielen = (uint)pwps_ie_src[1];/* to get ie data len */
|
||||||
if ((wps_offset + wps_ielen + 2 + remainder_ielen) <= MAX_IE_SZ) {
|
if ((wps_offset + wps_ielen + 2 + remainder_ielen) <= MAX_IE_SZ) {
|
||||||
|
@ -1213,6 +1213,7 @@ static void update_bcn_wps_ie(struct adapter *padapter)
|
||||||
pnetwork->IELength = wps_offset + (wps_ielen + 2) + remainder_ielen;
|
pnetwork->IELength = wps_offset + (wps_ielen + 2) + remainder_ielen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exit:
|
||||||
kfree(pbackup_remainder_ie);
|
kfree(pbackup_remainder_ie);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue