From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yonghong Song Subject: Re: [PATCH] test_bpf: Fix NULL vs IS_ERR() check in test_skb_segment() Date: Wed, 28 Mar 2018 09:19:27 -0700 Message-ID: References: <20180328114836.GD29050@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: Daniel Borkmann , , To: Dan Carpenter , Alexei Starovoitov Return-path: Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:35582 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752622AbeC1QVG (ORCPT ); Wed, 28 Mar 2018 12:21:06 -0400 In-Reply-To: <20180328114836.GD29050@mwanda> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 3/28/18 4:48 AM, Dan Carpenter wrote: > The skb_segment() function returns error pointers on error. It never > returns NULL. > > Fixes: 76db8087c4c9 ("net: bpf: add a test for skb_segment in test_bpf module") > Signed-off-by: Dan Carpenter > > diff --git a/lib/test_bpf.c b/lib/test_bpf.c > index b2badf6b23cd..8e157806df7a 100644 > --- a/lib/test_bpf.c > +++ b/lib/test_bpf.c > @@ -6649,7 +6649,7 @@ static __init int test_skb_segment(void) > } > > segs = skb_segment(skb, features); > - if (segs) { > + if (!IS_ERR(segs)) { > kfree_skb_list(segs); > ret = 0; > pr_info("%s: success in skb_segment!", __func__); Oh, my bad. Thanks for the fix! Reviewed-by: Yonghong Song