[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9220c4b5-ba0c-4bfe-a6d0-5b52631f4ad8@gmail.com>
Date: Fri, 18 Apr 2025 15:16:53 +0530
From: Purva Yeshi <purvayeshi550@...il.com>
To: David Ahern <dsahern@...nel.org>, Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: davem@...emloft.net, edumazet@...gle.com, horms@...nel.org,
kuba@...nel.org, linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
pabeni@...hat.com
Subject: Re: [PATCH] net: ipv4: Fix uninitialized pointer warning in
fnhe_remove_oldest
On 18/04/25 10:33, David Ahern wrote:
> On 4/17/25 4:00 PM, Kuniyuki Iwashima wrote:
>> From: Purva Yeshi <purvayeshi550@...il.com>
>> Date: Thu, 17 Apr 2025 15:11:26 +0530
>>> Fix Smatch-detected issue:
>>> net/ipv4/route.c:605 fnhe_remove_oldest() error:
>>> uninitialized symbol 'oldest_p'.
>>>
>>> Initialize oldest_p to NULL to avoid uninitialized pointer warning in
>>> fnhe_remove_oldest.
>>
>> How does it remain uninitialised ?
>>
>> update_or_create_fnhe() ensures the bucket is not empty before
>> calling fnhe_remove_oldest().
>>
>
> agreed. Not the simplest logic, but I do not see how oldest_p can be
> unset after the loop.
Hi David,
The loop always sets oldest_p when the list has at least one entry,
which the caller guarantees. Smatch doesn't catch that context, so it
flags a false positive.
Best regards,
Purva
Powered by blists - more mailing lists