lkml.org 
[lkml]   [2019]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fs/affs: release memory if affs_init_bitmap fails
Date
In affs_init_bitmap, on error handling path we may release the allocated
memory.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
fs/affs/bitmap.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/affs/bitmap.c b/fs/affs/bitmap.c
index 5ba9ef2742f6..745ed2cc4b51 100644
--- a/fs/affs/bitmap.c
+++ b/fs/affs/bitmap.c
@@ -347,6 +347,7 @@ int affs_init_bitmap(struct super_block *sb, int *flags)
out:
affs_brelse(bh);
affs_brelse(bmap_bh);
+ kfree(sbi->s_bitmap);
return res;
}

--
2.17.1
\
 
 \ /
  Last update: 2019-09-17 06:15    [W:0.065 / U:1.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site