From: FUJITA Tomonori Date: Sat, 21 Jul 2007 04:23:25 +0000 (+0900) Subject: [SCSI] bsg: fix bsg_unregister_queue X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=df468820b6881fc14e50f6b2fcffd3e945417d68;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [SCSI] bsg: fix bsg_unregister_queue scsi_sysfs_add_sdev ignores the bsg_register_queue failure, so bsg_unregister_queue must check whether the queue has a bsg device. Signed-off-by: FUJITA Tomonori Signed-off-by: James Bottomley --- diff --git a/block/bsg.c b/block/bsg.c index 4eebcd5c7311..1ba9bc6d9a44 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -932,7 +932,8 @@ void bsg_unregister_queue(struct request_queue *q) { struct bsg_class_device *bcd = &q->bsg_dev; - WARN_ON(!bcd->class_dev); + if (!bcd->class_dev) + return; mutex_lock(&bsg_mutex); sysfs_remove_link(&q->kobj, "bsg");