From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [PATCH] test_bpf: Fix NULL vs IS_ERR() check in test_skb_segment() Date: Wed, 28 Mar 2018 20:57:27 +0200 Message-ID: References: <20180328114836.GD29050@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, davem@davemloft.net To: Yonghong Song , Dan Carpenter , Alexei Starovoitov Return-path: Received: from www62.your-server.de ([213.133.104.62]:50055 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752457AbeC1S5d (ORCPT ); Wed, 28 Mar 2018 14:57:33 -0400 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Hi David, On 03/28/2018 06:19 PM, Yonghong Song wrote: > 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 If you have a chance, please take this fix directly into your net-next tree since it also contains the original commit 76db8087c4c9 ("net: bpf: add a test for skb_segment in test_bpf module"), which is not in the bpf-next tree at this point. Thanks a lot, Daniel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Date: Wed, 28 Mar 2018 18:57:27 +0000 Subject: Re: [PATCH] test_bpf: Fix NULL vs IS_ERR() check in test_skb_segment() Message-Id: List-Id: References: <20180328114836.GD29050@mwanda> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Yonghong Song , Dan Carpenter , Alexei Starovoitov Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, davem@davemloft.net Hi David, On 03/28/2018 06:19 PM, Yonghong Song wrote: > 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 If you have a chance, please take this fix directly into your net-next tree since it also contains the original commit 76db8087c4c9 ("net: bpf: add a test for skb_segment in test_bpf module"), which is not in the bpf-next tree at this point. Thanks a lot, Daniel