diff options
author | zhengbin <zhengbin13@huawei.com> | 2019-08-13 16:59:44 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-09-04 07:00:33 -0600 |
commit | ecf4d59a4ebf1237bde1cb2de71a0a6e927d4b0c (patch) | |
tree | 182b556cc5ec16e6e99e5e4d559461081b12ff5d /drivers/block | |
parent | c5ef62e60d50e2e9e0ff7aa240ad621eeda35939 (diff) | |
download | talos-op-linux-ecf4d59a4ebf1237bde1cb2de71a0a6e927d4b0c.tar.gz talos-op-linux-ecf4d59a4ebf1237bde1cb2de71a0a6e927d4b0c.zip |
paride/pf: need to set queue to NULL before put_disk
In pf_init_units, if blk_mq_init_sq_queue fails, need to set queue to
NULL before put_disk, otherwise null-ptr-deref Read will occur.
put_disk
kobject_put
disk_release
blk_put_queue(disk->queue)
Fixes: 77218ddf46d8 ("paride: convert pf to blk-mq")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/paride/pf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index 1e9c50a7256c..6b7d4cab3687 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c @@ -300,8 +300,8 @@ static void __init pf_init_units(void) disk->queue = blk_mq_init_sq_queue(&pf->tag_set, &pf_mq_ops, 1, BLK_MQ_F_SHOULD_MERGE); if (IS_ERR(disk->queue)) { - put_disk(disk); disk->queue = NULL; + put_disk(disk); continue; } |