Skip to contentSkip to conversation

btrfs-progs: remove unnecessary NULL check after get_df()

PATCH New Satoru Takeuchi 1 participant 1 message Jul 30, 2014 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs-progs: remove unnecessary NULL check after get_df()

From: Satoru Takeuchi <[email protected]>

If get_df() returns 0, "sargs" surely points to malloc'ed region. So NULL check of sargs is not necessary.

---
 cmds-filesystem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmds-filesystem.c +1 -1
index bf87bbe..38011e5 100644
@@ -201,7 +201,7 @@ static int cmd_filesystem_df(int argc, char **argv)
        }
        ret = get_df(fd, &sargs);
 
-       if (!ret && sargs) {
+       if (ret == 0) {
                print_df(sargs);
                free(sargs);
        } else {
Signature · 1 line
1.9.3