[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160413.225601.721902514935757078.davem@davemloft.net>
Date: Wed, 13 Apr 2016 22:56:01 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: weongyo.linux@...il.com
Cc: netdev@...r.kernel.org, willemb@...gle.com
Subject: Re: [PATCH net-next v3] packet: uses kfree_skb() for errors.
From: Weongyo Jeong <weongyo.linux@...il.com>
Date: Fri, 8 Apr 2016 09:25:48 -0700
> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> index 1ecfa71..4e054bb 100644
> --- a/net/packet/af_packet.c
> +++ b/net/packet/af_packet.c
> @@ -2042,6 +2042,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
> u8 *skb_head = skb->data;
> int skb_len = skb->len;
> unsigned int snaplen, res;
> + bool err = false;
>
> if (skb->pkt_type == PACKET_LOOPBACK)
> goto drop;
It is non-canonical to use a variable named 'err' as a boolean.
Instead, all programmers expect a variable named 'err' to be an
integer type and to hold an error code.
Therefore please use a more appropriate name for this variable.
Name it in a way which describes the exact important condition
which is true or false.
Thank you.
Powered by blists - more mailing lists