lkml.org 
[lkml]   [2021]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: r8188eu: fix memleak in rtw_wx_set_enc_ext
On Tue, Oct 19, 2021 at 10:23:56PM +0200, Martin Kaiser wrote:
> 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")
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
> drivers/staging/r8188eu/os_dep/ioctl_linux.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> index 4f0ae821d193..4e51d5a55985 100644
> --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> @@ -1897,7 +1897,7 @@ static int rtw_wx_set_enc_ext(struct net_device *dev,
> struct ieee_param *param = NULL;
> struct iw_point *pencoding = &wrqu->encoding;
> struct iw_encode_ext *pext = (struct iw_encode_ext *)extra;
> - int ret = 0;
> + int ret = -1;
>

This was in the original code, so it's fine to leave it as -1, but in
future patches could you change it to -EINVAL instead. (Or don't. I'm
not your boss. I appretiate all the clean up you have done to this
driver).

regards,
dan carpenter

\
 
 \ /
  Last update: 2021-11-02 14:32    [W:0.044 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site