[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <83b09a68-b759-2ae5-5918-53581731c9bf@citrix.com>
Date: Wed, 15 Feb 2017 21:30:08 +0000
From: Anoob Soman <anoob.soman@...rix.com>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: <netdev@...r.kernel.org>, <davem@...emloft.net>
Subject: Re: [PATCH v3 net] packet: Do not call fanout_release from atomic
contexts
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.
Powered by blists - more mailing lists