Skip to content

Commit

Permalink
[SCSI] bsg: fix bsg_unregister_queue
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Jul 21, 2007
1 parent 39dca55 commit df46882
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/bsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit df46882

Please sign in to comment.