aboutsummaryrefslogtreecommitdiffstats
path: root/block/bsg.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <tomof@acm.org>2007-07-21 00:23:25 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-07-21 09:58:41 -0400
commitdf468820b6881fc14e50f6b2fcffd3e945417d68 (patch)
treed1c0adca77b728dae3f4653de0388202d4f5ee5a /block/bsg.c
parent39dca558a5b52b63e49bc234a7e887be092aa690 (diff)
[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 <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'block/bsg.c')
-rw-r--r--block/bsg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/bsg.c b/block/bsg.c
index 4eebcd5c731..1ba9bc6d9a4 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -932,7 +932,8 @@ void bsg_unregister_queue(struct request_queue *q)
932{ 932{
933 struct bsg_class_device *bcd = &q->bsg_dev; 933 struct bsg_class_device *bcd = &q->bsg_dev;
934 934
935 WARN_ON(!bcd->class_dev); 935 if (!bcd->class_dev)
936 return;
936 937
937 mutex_lock(&bsg_mutex); 938 mutex_lock(&bsg_mutex);
938 sysfs_remove_link(&q->kobj, "bsg"); 939 sysfs_remove_link(&q->kobj, "bsg");