From 3b03f72445ba1437cfa29f9719bb3cfdb60558d9 Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Wed, 6 Nov 2013 09:12:04 +0800 Subject: f2fs: avoid to use a NULL point in destroy_segment_manager A NULL point should avoid to be used in destroy_segment_manager after allocating memory fail for f2fs_sm_info. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 3d4d5fc19e6f..ff363e686b7e 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1744,6 +1744,8 @@ static void destroy_sit_info(struct f2fs_sb_info *sbi) void destroy_segment_manager(struct f2fs_sb_info *sbi) { struct f2fs_sm_info *sm_info = SM_I(sbi); + if (!sm_info) + return; destroy_dirty_segmap(sbi); destroy_curseg(sbi); destroy_free_segmap(sbi); -- cgit v1.2.3