linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ishraq.i.ashraf@gmail.com
Cc: gregkh@linuxfoundation.org, himanshujha199640@gmail.com,
	goudapatilk@gmail.com, insafonov@gmail.com,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [PATCH 2/2] staging: rtl8188eu: Fix private WEXT IOCTL calls
Date: Sat, 25 Nov 2017 07:40:14 +0300	[thread overview]
Message-ID: <20171125044014.lfdwsrfgl4dz725d@mwanda> (raw)
In-Reply-To: <1511571155-12101-1-git-send-email-ishraq.i.ashraf@gmail.com>

Thanks for doing this.

This needs to be folded in with the earlier patch you send and then
resend it as a V2 patch.
https://kernelnewbies.org/FirstKernelPatch#head-5c81b3c517a1d0bbc24f92594cb734e155fcbbcb

I added Johannes to the CC list again because this is sort of his
fault...  To be honest, I'm a little bit puzzled.  I would have thought
Johannes's change would have made some code unused and that we could
delete it now.  I haven't looked at this.

>  
> -	if (ret == 0 && (copy_to_user(wrqu->data.pointer, param, wrqu->data.length)))
> +	if (pmlmepriv->htpriv.ht_option == false)
> +		psta->htpriv.ht_option = false;
> +
> +	update_sta_info_apmode(padapter, psta);
> +
> +	ret = 0;
> +
> +	if (copy_to_user(wrqu->data.pointer, param, wrqu->data.length))
>  		ret = -EFAULT;
>  
> -	return ret;
> +	err_free_param:
> +		kfree(param);
> +		return ret;
>  }

Please keep the success path and failure paths separate like I did in
the example code that I wrote in my email.  Don't indent the labels.  It
should look like this:

	update_sta_info_apmode(padapter, psta);

	if (copy_to_user(wrqu->data.pointer, param, wrqu->data.length)) {
		ret = -EFAULT;
		goto err_free_param;
	}

	kfree(param);
	return 0;

err_free_param:
	kfree(param);
	return ret;

regards,
dan carpenter

  reply	other threads:[~2017-11-25  4:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-23  1:29 [PATCH] staging: rtl8188eu: Fix private WEXT IOCTL calls ishraq.i.ashraf
2017-11-23 13:24 ` Dan Carpenter
2017-11-25  0:52 ` [PATCH 2/2] " ishraq.i.ashraf
2017-11-25  4:40   ` Dan Carpenter [this message]
2017-11-25 18:12     ` Ishraq Ibne Ashraf
2017-11-26  0:45     ` Ishraq Ibne Ashraf
2017-11-27 11:33       ` Johannes Berg
2017-11-25  1:29 ` [PATCH v2] " ishraq.i.ashraf
2017-11-25  4:55   ` Dan Carpenter
2017-11-25 18:29 ` [PATCH v3] " ishraq.i.ashraf
2017-11-25 21:25   ` Dan Carpenter
2017-11-27 11:24   ` Johannes Berg
2017-11-28  8:00   ` [PATCH] staging: rtl8188eu: fix kzalloc-simple.cocci warnings kbuild test robot
2017-11-28  8:00   ` [PATCH v3] staging: rtl8188eu: Fix private WEXT IOCTL calls kbuild test robot
2017-12-04 15:20   ` kbuild test robot
2017-11-26 20:45 ` [PATCH] " kbuild test robot
2017-11-26 23:20 ` kbuild test robot

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=20171125044014.lfdwsrfgl4dz725d@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=goudapatilk@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=himanshujha199640@gmail.com \
    --cc=insafonov@gmail.com \
    --cc=ishraq.i.ashraf@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).