Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5923991rwe; Tue, 18 Apr 2023 13:47:20 -0700 (PDT) X-Google-Smtp-Source: AKy350Y1io0gHKOsAwOzGoEmzWGCv75L4vSPCPtzZP31w4Oi2xiUCvRasf4TGgZHjbEEIkQHworH X-Received: by 2002:a17:902:d2cd:b0:1a6:91f0:f806 with SMTP id n13-20020a170902d2cd00b001a691f0f806mr3613311plc.58.1681850840283; Tue, 18 Apr 2023 13:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681850840; cv=none; d=google.com; s=arc-20160816; b=PKyvxOpeia22Pa+fLq8SlgS2IIhaYzLORCdLDbL66QThxls2BBMCD7QNzwWISPZYkc NpQcDaYnsIG4ULpxgObEMKqJDRDU/aAChUvaWqD7nMIuSv6EjdSoOVAYPjwqKMAbnObS hjzOJOscSd0eHuPj/D70QmAbhcza0Y3czjmyfE9Q8A6DiXDBeJ3dj6Q16OHxvC/sTSqC UafjcMdoGVbtt1wiFgmMOmr6keyYKFlZybIMC4MUgVllrJp4FwTcpRBXM+jHePdNrgIe D1A75MWd1xTwcNHrHW1LpDTHPFx3E3VxLqmxSCP6xRLqo6oeHFThTO1H3YF7JuwU1Sl6 SHmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=gIPfrb2IXU4L2BTFb0ngKAYvukC9NPtOstSk1pcVQp0=; b=jxm6RmakxdPihvE7yrDvfndVRR1npA4qAaHmSVT68bdRdQUeVRUDzruvknxQDU0EFq ynoyQlOsnWe0Xlb7c393ZtHRHCg6BsuYDxAUakRuMTvKpbES93Ess+zErncWRCZ9Lnaw wbPuXsubyoaDe66bTvQLGmLJk6dfNYmOSyCUwRFpSddRs1rORLvIGDlUwJP9BtonNytC ZmBRk0YnFNjpN1RP4NmvQhNV1qpUowUiNbonnRshYlpBpQG138VgylNhRbegqFKujOFm gsC2XaYh5jaHIKECNL2aLjsUyoPFLm0BlxHqsmbqShImBBtSOwoJYp8G3B7dz/puAoK7 2xiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FLEmW1mU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w18-20020a1709027b9200b001a6d4eab490si5639694pll.63.2023.04.18.13.47.05; Tue, 18 Apr 2023 13:47:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FLEmW1mU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232340AbjDRUqi (ORCPT + 99 others); Tue, 18 Apr 2023 16:46:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231171AbjDRUqg (ORCPT ); Tue, 18 Apr 2023 16:46:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AD77B2; Tue, 18 Apr 2023 13:46:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1C716638D9; Tue, 18 Apr 2023 20:46:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 150E0C433EF; Tue, 18 Apr 2023 20:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681850794; bh=PTE4R9f1OKfuM9nJaj9mQ4McfsyLeyxfNyTbqxHTrXw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=FLEmW1mUWBBzrbWSt0tUPLtwH2XFzHDBAdA4gbHvutgJ1W239y6FMStmuRwn5j5NN Lgs0v59QlHTIP0p7iGmRljpg0Uh5UvWHc1ofmLHf6w85mhhcA6BVxP7IjBAKgld3RW B79ZFivt2iuYrbdPipSxUoMr2BktOps/wmfyRXYBquE732c2141SScZvYlC25Loqde CaLAbPQiJ7HunwTRsu7Ucmw/Kf8ht3YjiivEJO47jpXJCwO3pNT7M5Ot7UBkaYEJZK BTB7f19cjZcd2yasMUaroiXXYARMk9MCo8mhCWcf978Z0CyhJyLgDkCsSAKKBqppfu 94y+LZtAGT36A== Message-ID: Date: Tue, 18 Apr 2023 14:46:33 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH net-next v2] net/ipv6: silence 'passing zero to ERR_PTR()' warning Content-Language: en-US To: Jakub Kicinski , Dan Carpenter Cc: Haoyi Liu , "David S. Miller" , Eric Dumazet , Paolo Abeni , hust-os-kernel-patches@googlegroups.com, yalongz@hust.edu.cn, Dongliang Mu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230413101005.7504-1-iccccc@hust.edu.cn> <11c76aa6-4c19-4f1d-86dd-e94e683dbd64@kili.mountain> <20230417191734.78c18a5f@kernel.org> From: David Ahern In-Reply-To: <20230417191734.78c18a5f@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/17/23 8:17 PM, Jakub Kicinski wrote: > On Fri, 14 Apr 2023 09:32:51 +0300 Dan Carpenter wrote: >> Also it can return NULL. >> >> net/xfrm/xfrm_policy.c >> 3229 dst = dst_orig; >> 3230 } >> 3231 ok: >> 3232 xfrm_pols_put(pols, drop_pols); >> 3233 if (dst && dst->xfrm && >> ^^^ >> "dst" is NULL. > > Don't take my word for it, but AFAICT it's impossible to get there with > dst == NULL. I think we can remove this check instead if that's what > makes smatch infer that dst may be NULL. > That was my conclusion as well staring at it multiple times, but given the horrible maze of goto's I cannot definitively say that.