[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f920c935-3876-c8bc-cb6e-c8740d64a6e4@kernel.org>
Date: Tue, 18 Apr 2023 14:46:33 -0600
From: David Ahern <dsahern@...nel.org>
To: Jakub Kicinski <kuba@...nel.org>, Dan Carpenter <error27@...il.com>
Cc: Haoyi Liu <iccccc@...t.edu.cn>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
hust-os-kernel-patches@...glegroups.com, yalongz@...t.edu.cn,
Dongliang Mu <dzm91@...t.edu.cn>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v2] net/ipv6: silence 'passing zero to ERR_PTR()'
warning
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.
Powered by blists - more mailing lists