public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Anoob Soman <anoob.soman@citrix.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>
Subject: Re: [PATCH v3 net] packet: Do not call fanout_release from atomic contexts
Date: Wed, 15 Feb 2017 21:30:08 +0000	[thread overview]
Message-ID: <83b09a68-b759-2ae5-5918-53581731c9bf@citrix.com> (raw)
In-Reply-To: <1487192551.1311.28.camel@edumazet-glaptop3.roam.corp.google.com>

On 15/02/17 21:02, Eric Dumazet wrote:
> On Wed, 2017-02-15 at 20:25 +0000, Anoob Soman wrote:
>
>> +static struct packet_fanout *fanout_release(struct sock *sk)
>>   {
>>   	struct packet_sock *po = pkt_sk(sk);
>>   	struct packet_fanout *f;
>> @@ -1728,17 +1736,17 @@ static void fanout_release(struct sock *sk)
>>   	if (f) {
>>   		po->fanout = NULL;
>>   
>> -		if (atomic_dec_and_test(&f->sk_ref)) {
>> +		if (atomic_dec_and_test(&f->sk_ref))
>>   			list_del(&f->list);
>> -			dev_remove_pack(&f->prot_hook);
>> -			fanout_release_data(f);
>> -			kfree(f);
>> -		}
>> +		else
>> +			f = NULL;
>
> Patch looks good, except this coding style issue.
>
> if (...) {
>          multi lines;
>          expressions;
> } else {
>          f = NULL;
> }
>
>
> Not :
>
> if (...) {
>          multi lines;
>          expressions;
> } else
>          f = NULL;
If statement looks like this.
if (atomic_dec_and_test(sk_ref))
     list_del(f->list);
else
    f = NULL;

there are no multiple lines under if.

  reply	other threads:[~2017-02-15 21:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15 20:25 [PATCH v3 net] packet: Do not call fanout_release from atomic contexts Anoob Soman
2017-02-15 21:02 ` Eric Dumazet
2017-02-15 21:30   ` Anoob Soman [this message]
2017-02-15 21:34     ` Eric Dumazet
2017-02-15 21:33   ` Eric Dumazet
2017-02-17 16:13 ` David Miller

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=83b09a68-b759-2ae5-5918-53581731c9bf@citrix.com \
    --to=anoob.soman@citrix.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@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