[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpULrWMNtgDcrZkc-uLtB0XOVFeZxQ6cFgpXwv7DtA9jzA@mail.gmail.com>
Date: Thu, 7 Jun 2018 16:59:36 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Ben Greear <greearb@...delatech.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: [PATCH v2] net-fq: Add WARN_ON check for null flow.
On Thu, Jun 7, 2018 at 4:48 PM, <greearb@...delatech.com> wrote:
> diff --git a/include/net/fq_impl.h b/include/net/fq_impl.h
> index be7c0fa..cb911f0 100644
> --- a/include/net/fq_impl.h
> +++ b/include/net/fq_impl.h
> @@ -78,7 +78,10 @@ static struct sk_buff *fq_tin_dequeue(struct fq *fq,
> return NULL;
> }
>
> - flow = list_first_entry(head, struct fq_flow, flowchain);
> + flow = list_first_entry_or_null(head, struct fq_flow, flowchain);
> +
> + if (WARN_ON_ONCE(!flow))
> + return NULL;
This does not make sense either. list_first_entry_or_null()
returns NULL only when the list is empty, but we already check
list_empty() right before this code, and it is protected by fq->lock.
Powered by blists - more mailing lists