Coverity reports assigning value from "err" to "ret", but that stored
value is overwritten by check_extent_refs() before it can be used.

Signed-off-by: Eryu Guan <[email protected]>
---
 cmds-check.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/cmds-check.c b/cmds-check.c
index 4225b21..80a7c29 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -8066,13 +8066,12 @@ again:
                goto out;
        }
 
-       err = check_chunks(&chunk_cache, &block_group_cache,
+       ret = check_chunks(&chunk_cache, &block_group_cache,
                           &dev_extent_cache, NULL, NULL, NULL, 0);
-       if (err) {
-               if (err == -EAGAIN)
+       if (ret) {
+               if (ret == -EAGAIN)
                        goto loop;
-               if (!ret)
-                       ret = err;
+               err = ret;
        }
 
        ret = check_extent_refs(root, &extent_cache);
@@ -8082,8 +8081,8 @@ again:
                goto out;
        }
 
-       err = check_devices(&dev_cache, &dev_extent_cache);
-       if (err && !ret)
+       ret = check_devices(&dev_cache, &dev_extent_cache);
+       if (ret && err)
                ret = err;
 
 out:
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to