Skip to content

Commit ecf4d59

Browse files
zhengbin13axboe
authored andcommitted
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: 77218dd ("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>
1 parent c5ef62e commit ecf4d59

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/block/paride

‎drivers/block/paride/pf.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ static void __init pf_init_units(void)
300300
disk->queue = blk_mq_init_sq_queue(&pf->tag_set, &pf_mq_ops,
301301
1, BLK_MQ_F_SHOULD_MERGE);
302302
if (IS_ERR(disk->queue)) {
303-
put_disk(disk);
304303
disk->queue = NULL;
304+
put_disk(disk);
305305
continue;
306306
}
307307

0 commit comments

Comments
 (0)