From b570afae4d5648dd8edfab62e84a8fd987ff1f67 Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Mon, 12 Oct 2015 21:22:58 +0800 Subject: [PATCH] btrfs-progs: inspect: set return value of error case In case of open_file_or_dir() failed, ret is not set to right value, and the function will return unwanted value(ret of sprintf). Signed-off-by: Zhao Lei Signed-off-by: David Sterba --- cmds-inspect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds-inspect.c b/cmds-inspect.c index 879fd43c..a13a170e 100644 --- a/cmds-inspect.c +++ b/cmds-inspect.c @@ -243,6 +243,7 @@ static int cmd_inspect_logical_resolve(int argc, char **argv) if (path_fd < 0) { fprintf(stderr, "ERROR: can't access " "'%s'\n", full_path); + ret = -ENOENT; goto out; } }