Commit 393db0f6 authored by Pavel Skripkin's avatar Pavel Skripkin Committed by Greg Kroah-Hartman

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: 15865124 ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Signed-off-by: default avatarPavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/ee783fbb71abb549505b84542223be7a7c905eea.1630692375.git.paskripkin@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3821a784
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment