aboutsummaryrefslogtreecommitdiffstats
path: root/block/bsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/bsg.c')
-rw-r--r--block/bsg.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/bsg.c b/block/bsg.c
index 4e0be1b2e2a0..0e3d5d490d20 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -993,7 +993,7 @@ retry:
993 if (q->kobj.sd) { 993 if (q->kobj.sd) {
994 ret = sysfs_create_link(&q->kobj, &bcd->class_dev->kobj, "bsg"); 994 ret = sysfs_create_link(&q->kobj, &bcd->class_dev->kobj, "bsg");
995 if (ret) 995 if (ret)
996 goto err; 996 goto err_unregister;
997 } 997 }
998 998
999 list_add_tail(&bcd->list, &bsg_class_list); 999 list_add_tail(&bcd->list, &bsg_class_list);
@@ -1001,9 +1001,10 @@ retry:
1001 1001
1002 mutex_unlock(&bsg_mutex); 1002 mutex_unlock(&bsg_mutex);
1003 return 0; 1003 return 0;
1004
1005err_unregister:
1006 class_device_unregister(class_dev);
1004err: 1007err:
1005 if (class_dev)
1006 class_device_destroy(bsg_class, MKDEV(bsg_major, bcd->minor));
1007 mutex_unlock(&bsg_mutex); 1008 mutex_unlock(&bsg_mutex);
1008 return ret; 1009 return ret;
1009} 1010}