Benjamin Coddington 61ceeebbd2 NFSv4: Fixup smatch warning for ambiguous return
[ Upstream commit 37ffe06537af3e3ec212e7cbe941046fce0a822f ]

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@linaro.org>
Fixes: c3ed222745d9 ("NFSv4: Fix free of uninitialized nfs4_label on referral lookup.")
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-16 13:39:46 +02:00
..
2024-04-10 16:18:38 +02:00
2024-02-23 08:54:51 +01:00
2021-12-29 12:28:59 +01:00
2024-06-16 13:39:16 +02:00
2023-09-19 12:22:53 +02:00
2024-03-01 13:21:43 +01:00
2023-09-23 11:10:01 +02:00
2023-12-08 08:48:04 +01:00
2023-08-30 16:18:19 +02:00
2024-04-10 16:19:01 +02:00
2022-12-14 11:37:31 +01:00
2023-01-12 11:58:47 +01:00
2022-07-02 16:41:17 +02:00
2022-07-12 16:35:08 +02:00
2021-12-14 10:57:15 +01:00