Commit 37ffe06
NFSv4: Fixup smatch warning for ambiguous return
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: c3ed222 ("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>1 parent bf95f82 commit 37ffe06
1 file changed
Lines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2116 | 2116 | | |
2117 | 2117 | | |
2118 | 2118 | | |
| 2119 | + | |
2119 | 2120 | | |
2120 | 2121 | | |
2121 | 2122 | | |
| |||
2125 | 2126 | | |
2126 | 2127 | | |
2127 | 2128 | | |
2128 | | - | |
2129 | 2129 | | |
2130 | 2130 | | |
2131 | | - | |
2132 | | - | |
2133 | | - | |
2134 | | - | |
2135 | | - | |
2136 | | - | |
| 2131 | + | |
| 2132 | + | |
2137 | 2133 | | |
| 2134 | + | |
2138 | 2135 | | |
2139 | 2136 | | |
2140 | 2137 | | |
| 2138 | + | |
2141 | 2139 | | |
2142 | 2140 | | |
2143 | 2141 | | |
| |||
0 commit comments