Skip to content
Commit 03252259 authored by Wenchao Hao's avatar Wenchao Hao Committed by Martin K. Petersen
Browse files

scsi: sd: Clean up gendisk if device_add_disk() failed

We forgot to call blk_cleanup_disk() when device_add_disk() failed.  This
would cause a memory leak of gendisk and sched_tags allocated in
elevator_init_mq()

Reference:https://syzkaller.appspot.com/x/log.txt?x=13b41dcb700000


Reported-and-tested-by: default avatar <syzbot+f08c77040fa163a75a46@syzkaller.appspotmail.com>
Link: https://lore.kernel.org/r/20220401011018.1026553-1-haowenchao@huawei.com


Signed-off-by: default avatarWenchao Hao <haowenchao@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 61144d83
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment