[PATCH] fs: ubifs: remove dead code

Heiko Schocher hs at nabladev.com
Mon May 18 15:39:36 CEST 2026


Hello Peter,

On 14.05.26 05:08, Peter Collingbourne wrote:
> Hi Heiko,
> 
> On Wed, May 13, 2026 at 7:50 PM Heiko Schocher <hs at nabladev.com> wrote:
>>
>> Hello Peter,
>>
>> On 12.05.26 07:50, Peter Collingbourne wrote:
>>> This code is dead because it appears after an infinite loop; remove it.
>>>
>>> Fixes: 4c4477c77008 ("fs: ubifs: fix bugs involving symlinks in ubifs_findfile")
>>
>> Wrong commit ID? I find in current HEAD:
>> """
>> commit d5888d509cc43942ec98d993f2d129f5c8ddc432
>> Author: Peter Collingbourne <peter at pcc.me.uk>
>> Date:   Tue May 5 03:38:16 2026 -0700
>>
>>       fs: ubifs: fix bugs involving symlinks in ubifs_findfile
>> """
> 
> Yeah, I see the same. Looks like I accidentally used my original
> commit ID instead of the one that was pushed.
> 
>>> Signed-off-by: Peter Collingbourne <peter at pcc.me.uk>
>>> ---
>>>    fs/ubifs/ubifs.c | 3 ---
>>>    1 file changed, 3 deletions(-)

Applied to u-boot-ubi.git

Thanks!

bye,
Heiko

>>>
>>> diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
>>> index aafbd01a028..3f2e2037745 100644
>>> --- a/fs/ubifs/ubifs.c
>>> +++ b/fs/ubifs/ubifs.c
>>> @@ -608,9 +608,6 @@ static unsigned long ubifs_findfile(struct super_block *sb, char *filename)
>>>                root_inum = inum;
>>>                name = next;
>>>        }
>>> -
>>> -     kfree(buf);
>>> -     return 0;
>>
>> May we need to stay with "return 0;" at the end of the function, as
>> some source code checking tool will claim if there is none?
> 
> I'd probably remove it unless some tool complains. If there's code at
> the end it can mislead readers into thinking it's reachable, which is
> how I ended up adding the kfree() there in the first place.
> 
>> Beside of the nitpick:
>>
>> Reviewed-by: Heiko Schocher <hs at nabladev.com>
>>
>> If you find time to send a v2 with updated commit ID I would be happy,
>> else I can fix it when picking up the patch, if okay for you.
> 
> Feel free to fix it up, thanks.
> 
> Peter
> 

-- 
Nabla Software Engineering
HRB 40522 Augsburg
Phone: +49 821 45592596
E-Mail: office at nabladev.com
Geschäftsführer : Stefano Babic


More information about the U-Boot mailing list