btrfs-progs: cmds: resize: fix check_resize_args() return value
PATCH 1/1 btrfs-progs: cmds: resize: fix check_resize_args() return value
check_resize_args() function checks user argument amount and should returns it's validity. But now the code returns only zero. This patch make it correct to return ret. It also needs to set to zero after checking argument length.
Signed-off-by Sidong Yang <[email protected]>
--- cmds/filesystem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
cmds/filesystem.c +2 -1
@@ -1122,6 +1122,7 @@ static int check_resize_args(const char *amount, const char *path) { ret =1 ; goto out; } + ret =0 ; sizestr = amount_dup; devstr =strchr (sizestr,':' );
@@ -1208,7 +1209,7 @@ static int check_resize_args(const char *amount, const char *path) { out:free (di_args); -return 0 ; +return ret; } static int cmd_filesystem_resize(const struct cmd_struct *cmd,
Signature · 1 line
2.34.1
Quoted 6 lines · Sidong Yang
check_resize_args()function checks user argument amount and should returns it's validity. But now the code returns only zero. This patch make it correct to return ret. It also needs to set to zero after checking argument length.Signed-off-by Sidong Yang <[email protected]>
Added to devel, thanks.