From: Navid Emamdoost <navid.emamdoost@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu,
Navid Emamdoost <navid.emamdoost@gmail.com>,
David Sterba <dsterba@suse.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] fs/affs: release memory if affs_init_bitmap fails
Date: Mon, 16 Sep 2019 23:13:42 -0500 [thread overview]
Message-ID: <20190917041346.4802-1-navid.emamdoost@gmail.com> (raw)
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
next reply other threads:[~2019-09-17 4:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-17 4:13 Navid Emamdoost [this message]
2019-09-17 9:52 ` [PATCH] fs/affs: release memory if affs_init_bitmap fails David Sterba
2019-09-25 22:29 ` Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190917041346.4802-1-navid.emamdoost@gmail.com \
--to=navid.emamdoost@gmail.com \
--cc=dsterba@suse.com \
--cc=emamd001@umn.edu \
--cc=kjlu@umn.edu \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=smccaman@umn.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).