Skip to contentSkip to conversation

hugetlbfs: hugetlbfs_fill_super(): remove kfree() redundant null check

PATCH In review Tim Gardner 2 participants 2 messages Feb 12, 2013 HugeTLB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hugetlbfs: hugetlbfs_fill_super(): remove kfree() redundant null check

smatch analysis:

fs/hugetlbfs/inode.c:883 hugetlbfs_fill_super() info: redundant null check on sbinfo->spool calling kfree()

Cc Nadia Yvette Chambers <[email protected]>
---
 fs/hugetlbfs/inode.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/hugetlbfs/inode.c +1 -2
index 78bde32..e2e36ef 100644
@@ -879,8 +879,7 @@ hugetlbfs_fill_super(struct super_block *sb, void *data, int silent)
 		goto out_free;
 	return 0;
 out_free:
-	if (sbinfo->spool)
-		kfree(sbinfo->spool);
+	kfree(sbinfo->spool);
 	kfree(sbinfo);
 	return -ENOMEM;
 }
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw
Quoted 29 lines · Tim Gardner

smatch analysis:

fs/hugetlbfs/inode.c:883 hugetlbfs_fill_super() info: redundant null check on sbinfo->spool calling kfree()

Cc Nadia Yvette Chambers <[email protected]>
---
 fs/hugetlbfs/inode.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/hugetlbfs/inode.c +1 -2
index 78bde32..e2e36ef 100644
@@ -879,8 +879,7 @@ hugetlbfs_fill_super(struct super_block *sb, void *data,
 int silent)
                 goto out_free;
         return 0;
 out_free:
-        if (sbinfo->spool)
-                kfree(sbinfo->spool);
+        kfree(sbinfo->spool);
         kfree(sbinfo);
         return -ENOMEM;

}
--
1.7.9.5