提交 059ea331 编写于 作者: L Li Zefan 提交者: Jens Axboe

block: fix memory leak in bio_clone()

If bio_integrity_clone() fails, bio_clone() returns NULL without freeing
the newly allocated bio.
Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 87092698
......@@ -465,8 +465,10 @@ struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask)
ret = bio_integrity_clone(b, bio, gfp_mask, fs_bio_set);
if (ret < 0)
if (ret < 0) {
bio_put(b);
return NULL;
}
}
return b;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册