diff options
Diffstat (limited to 'block/bsg.c')
-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 0c8b64a16484..792ead666757 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -985,7 +985,8 @@ void bsg_unregister_queue(struct request_queue *q) mutex_lock(&bsg_mutex); idr_remove(&bsg_minor_idr, bcd->minor); - sysfs_remove_link(&q->kobj, "bsg"); + if (q->kobj.sd) + sysfs_remove_link(&q->kobj, "bsg"); device_unregister(bcd->class_dev); bcd->class_dev = NULL; kref_put(&bcd->ref, bsg_kref_release_function); |