提交 7f053a6a 编写于 作者: S Shaohua Li

MD: fix a null dereference

rdev->mddev could be null in start time.
Reported-by: NMing Lei <ming.lei@redhat.com>
Fix: 5a85071c(md: use a separate bio_set for synchronous IO.)
Cc: NeilBrown <neilb@suse.com>
Signed-off-by: NShaohua Li <shli@fb.com>
上级 5a85071c
...@@ -205,7 +205,7 @@ EXPORT_SYMBOL_GPL(bio_alloc_mddev); ...@@ -205,7 +205,7 @@ EXPORT_SYMBOL_GPL(bio_alloc_mddev);
static struct bio *md_bio_alloc_sync(struct mddev *mddev) static struct bio *md_bio_alloc_sync(struct mddev *mddev)
{ {
if (!mddev->sync_set) if (!mddev || !mddev->sync_set)
return bio_alloc(GFP_NOIO, 1); return bio_alloc(GFP_NOIO, 1);
return bio_alloc_bioset(GFP_NOIO, 1, mddev->sync_set); return bio_alloc_bioset(GFP_NOIO, 1, mddev->sync_set);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册