Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759152AbcLAP2E (ORCPT ); Thu, 1 Dec 2016 10:28:04 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34568 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754530AbcLAP2C (ORCPT ); Thu, 1 Dec 2016 10:28:02 -0500 Message-ID: <1480606078.18162.297.camel@edumazet-glaptop3.roam.corp.google.com> Subject: Re: [PATCH] ip6_offload: check segs for NULL in ipv6_gso_segment. From: Eric Dumazet To: Artem Savkov Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jstancek@redhat.com, steffen.klassert@secunet.com, alexander.h.duyck@intel.com, YOSHIFUJI Hideaki / =?UTF-8?Q?=E5=90=89=E8=97=A4=E8=8B=B1=E6=98=8E?= Date: Thu, 01 Dec 2016 07:27:58 -0800 In-Reply-To: <20161201150703.dv463hxgqajqo6pm@shodan.usersys.redhat.com> References: <1480597564-32355-1-git-send-email-asavkov@redhat.com> <1480602847.18162.288.camel@edumazet-glaptop3.roam.corp.google.com> <20161201150703.dv463hxgqajqo6pm@shodan.usersys.redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 626 Lines: 24 On Thu, 2016-12-01 at 16:07 +0100, Artem Savkov wrote: > I am not, but this would have the same behavior as pre-07b26c9 code and > IS_ERR_OR_NULL is used in ipv4's inet_gso_segment(). My concern might have been that IS_ERR_OR_NULL() considers the !ptr to be unlikely. But in this code path, we really can not tell. segs == NULL can be quite likely in TUN case, because of DODGY bit Commit 50c3a487d50756 replaced the perfectly fine : if (!segs || IS_ERR(segs)) into dubious if (IS_ERR_OR_NULL(segs)) segs = NULL is not an error, but use of IS_ERR_OR_NULL() might mislead programmers trying to understand this code.