From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E8AFC77B75 for ; Tue, 18 Apr 2023 20:46:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232492AbjDRUqk (ORCPT ); Tue, 18 Apr 2023 16:46:40 -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 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.