diff options
author | Tim Gardner <tim.gardner@canonical.com> | 2013-02-21 19:42:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 20:22:19 -0500 |
commit | d787ab0977c58e2c421b8d0ab49e363893ddb814 (patch) | |
tree | d55c305e7e011fcb271f8b8be4a7bc94274712a1 /fs/ocfs2/super.c | |
parent | 49deb4bc227cb9db5b8ebf9434367f8bed057c7a (diff) |
ocfs2: remove kfree() redundant null checks
smatch analysis indicates a number of redundant NULL checks before
calling kfree(), eg:
fs/ocfs2/alloc.c:6138 ocfs2_begin_truncate_log_recovery() info:
redundant null check on *tl_copy calling kfree()
fs/ocfs2/alloc.c:6755 ocfs2_zero_range_for_truncate() info:
redundant null check on pages calling kfree()
etc....
[akpm@linux-foundation.org: revert dubious change in ocfs2_begin_truncate_log_recovery()]
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Acked-by: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r-- | fs/ocfs2/super.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 0e91ec22a940..9b6910dec4ba 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -2525,8 +2525,7 @@ static int ocfs2_check_volume(struct ocfs2_super *osb) | |||
2525 | mlog_errno(status); | 2525 | mlog_errno(status); |
2526 | 2526 | ||
2527 | finally: | 2527 | finally: |
2528 | if (local_alloc) | 2528 | kfree(local_alloc); |
2529 | kfree(local_alloc); | ||
2530 | 2529 | ||
2531 | if (status) | 2530 | if (status) |
2532 | mlog_errno(status); | 2531 | mlog_errno(status); |
@@ -2553,8 +2552,7 @@ static void ocfs2_delete_osb(struct ocfs2_super *osb) | |||
2553 | * we free it here. | 2552 | * we free it here. |
2554 | */ | 2553 | */ |
2555 | kfree(osb->journal); | 2554 | kfree(osb->journal); |
2556 | if (osb->local_alloc_copy) | 2555 | kfree(osb->local_alloc_copy); |
2557 | kfree(osb->local_alloc_copy); | ||
2558 | kfree(osb->uuid_str); | 2556 | kfree(osb->uuid_str); |
2559 | ocfs2_put_dlm_debug(osb->osb_dlm_debug); | 2557 | ocfs2_put_dlm_debug(osb->osb_dlm_debug); |
2560 | memset(osb, 0, sizeof(struct ocfs2_super)); | 2558 | memset(osb, 0, sizeof(struct ocfs2_super)); |