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>
This commit is contained in:

committed by
Linus Torvalds

parent
49deb4bc22
commit
d787ab0977
@@ -1471,8 +1471,7 @@ static void o2hb_region_release(struct config_item *item)
|
||||
|
||||
mlog(ML_HEARTBEAT, "hb region release (%s)\n", reg->hr_dev_name);
|
||||
|
||||
if (reg->hr_tmp_block)
|
||||
kfree(reg->hr_tmp_block);
|
||||
kfree(reg->hr_tmp_block);
|
||||
|
||||
if (reg->hr_slot_data) {
|
||||
for (i = 0; i < reg->hr_num_pages; i++) {
|
||||
@@ -1486,8 +1485,7 @@ static void o2hb_region_release(struct config_item *item)
|
||||
if (reg->hr_bdev)
|
||||
blkdev_put(reg->hr_bdev, FMODE_READ|FMODE_WRITE);
|
||||
|
||||
if (reg->hr_slots)
|
||||
kfree(reg->hr_slots);
|
||||
kfree(reg->hr_slots);
|
||||
|
||||
kfree(reg->hr_db_regnum);
|
||||
kfree(reg->hr_db_livenodes);
|
||||
|
@@ -1165,10 +1165,8 @@ out:
|
||||
o2net_debug_del_nst(&nst); /* must be before dropping sc and node */
|
||||
if (sc)
|
||||
sc_put(sc);
|
||||
if (vec)
|
||||
kfree(vec);
|
||||
if (msg)
|
||||
kfree(msg);
|
||||
kfree(vec);
|
||||
kfree(msg);
|
||||
o2net_complete_nsw(nn, &nsw, 0, 0, 0);
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user