Commit df468820 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley

[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: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 39dca558
...@@ -932,7 +932,8 @@ void bsg_unregister_queue(struct request_queue *q) ...@@ -932,7 +932,8 @@ void bsg_unregister_queue(struct request_queue *q)
{ {
struct bsg_class_device *bcd = &q->bsg_dev; struct bsg_class_device *bcd = &q->bsg_dev;
WARN_ON(!bcd->class_dev); if (!bcd->class_dev)
return;
mutex_lock(&bsg_mutex); mutex_lock(&bsg_mutex);
sysfs_remove_link(&q->kobj, "bsg"); sysfs_remove_link(&q->kobj, "bsg");
......
Markdown is supported
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