staging: r8188eu: fix memleak in rtw_wx_set_enc_ext
authorMartin Kaiser <martin@kaiser.cx>
Tue, 19 Oct 2021 20:23:56 +0000 (22:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Nov 2021 14:05:51 +0000 (15:05 +0100)
commit4787caef521c462d3eccc8dc7d2cbefc58522fdb
treee122c90a249838f05d43621fb6379a259dbb339c
parent8f60f9f6ee2498c6abd2d422f9a44f6d12d5cecd
staging: r8188eu: fix memleak in rtw_wx_set_enc_ext

commit 26f448371820cf733c827c11f0c77ce304a29b51 upstream.

Free the param struct if the caller sets an unsupported algorithm
and we return an error.

Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211019202356.12572-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/os_dep/ioctl_linux.c