[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1487192551.1311.28.camel@edumazet-glaptop3.roam.corp.google.com>
Date: Wed, 15 Feb 2017 13:02:31 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Anoob Soman <anoob.soman@...rix.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH v3 net] packet: Do not call fanout_release from atomic
contexts
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;
Powered by blists - more mailing lists