Message ID | 20190722141236.103967-2-colyli@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | bcache fix for Linux v5.3-rc2 | expand |
On 7/22/19 8:12 AM, Coly Li wrote: > From: Wei Yongjun <weiyongjun1@huawei.com> > > memory malloced in bch_cached_dev_run() and should be freed before > leaving from the error handling cases, otherwise it will cause > memory leak. Applied, thanks.
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 26e374fbf57c..20ed838e9413 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -931,6 +931,9 @@ int bch_cached_dev_run(struct cached_dev *dc) if (dc->io_disable) { pr_err("I/O disabled on cached dev %s", dc->backing_dev_name); + kfree(env[1]); + kfree(env[2]); + kfree(buf); return -EIO; }