public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Martin Kaiser <martin@kaiser.cx>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>,
	Michael Straube <straube.linux@gmail.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: r8188eu: fix memleak in rtw_wx_set_enc_ext
Date: Tue, 2 Nov 2021 16:31:22 +0300	[thread overview]
Message-ID: <20211102133122.GH2794@kadam> (raw)
In-Reply-To: <20211019202356.12572-1-martin@kaiser.cx>

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


  reply	other threads:[~2021-11-02 13:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 20:23 [PATCH] staging: r8188eu: fix memleak in rtw_wx_set_enc_ext Martin Kaiser
2021-11-02 13:31 ` Dan Carpenter [this message]
2021-11-07 14:53   ` Martin Kaiser

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=20211102133122.GH2794@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=martin@kaiser.cx \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@gmail.com \
    /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