linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: remove unnecessary NULL check after get_df()
@ 2014-07-30  7:26 Satoru Takeuchi
  0 siblings, 0 replies; only message in thread
From: Satoru Takeuchi @ 2014-07-30  7:26 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org

From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

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

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

---
 cmds-filesystem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index bf87bbe..38011e5 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -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 {
-- 
1.9.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-30  7:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-30  7:26 [PATCH] btrfs-progs: remove unnecessary NULL check after get_df() Satoru Takeuchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).