diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/bsg.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/bsg.c b/block/bsg.c index 4cf703fd98bb..ff64ae3bacee 100644 --- a/block/bsg.c +++ b/block/bsg.c | |||
@@ -983,7 +983,8 @@ void bsg_unregister_queue(struct request_queue *q) | |||
983 | 983 | ||
984 | mutex_lock(&bsg_mutex); | 984 | mutex_lock(&bsg_mutex); |
985 | idr_remove(&bsg_minor_idr, bcd->minor); | 985 | idr_remove(&bsg_minor_idr, bcd->minor); |
986 | sysfs_remove_link(&q->kobj, "bsg"); | 986 | if (q->kobj.sd) |
987 | sysfs_remove_link(&q->kobj, "bsg"); | ||
987 | device_unregister(bcd->class_dev); | 988 | device_unregister(bcd->class_dev); |
988 | bcd->class_dev = NULL; | 989 | bcd->class_dev = NULL; |
989 | kref_put(&bcd->ref, bsg_kref_release_function); | 990 | kref_put(&bcd->ref, bsg_kref_release_function); |