From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Greear Subject: Re: [PATCH v2] net-fq: Add WARN_ON check for null flow. Date: Fri, 8 Jun 2018 07:08:15 -0700 Message-ID: <30d38ca1-c175-7ade-048c-e7319716aeeb@candelatech.com> References: <1528415316-6379-1-git-send-email-greearb@candelatech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Linux Kernel Network Developers To: Cong Wang Return-path: Received: from mail2.candelatech.com ([208.74.158.173]:59660 "EHLO mail2.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751523AbeFHOIW (ORCPT ); Fri, 8 Jun 2018 10:08:22 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On 06/07/2018 04:59 PM, Cong Wang wrote: > On Thu, Jun 7, 2018 at 4:48 PM, 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. > Nevermind then. Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com