Re: [PATCH] NFSv4: Fixup smatch warning for ambiguous return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 17, 2024 at 02:49:29PM -0400, Benjamin Coddington wrote:
> Dan Carpenter reports smatch warning for nfs4_try_migration() when a memory
> allocation failure results in a zero return value.  In this case, a
> transient allocation failure error will likely be retried the next time the
> server responds with NFS4ERR_MOVED.
> 
> We can fixup the smatch warning with a small refactor: attempt all three
> allocations before testing and returning on a failure.
> 
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Fixes: c3ed222745d9 ("NFSv4: Fix free of uninitialized nfs4_label on referral lookup.")
> Signed-off-by: Benjamin Coddington <bcodding@xxxxxxxxxx>
> ---

This preserves the existing behavior and makes the code more readable.

Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

regards,
dan carpenter





[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux