Message ID | 1426717101-26910-1-git-send-email-wenxiong@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c index 38552a3..0d20e19 100644 --- a/drivers/misc/enclosure.c +++ b/drivers/misc/enclosure.c @@ -209,6 +209,9 @@ static void enclosure_remove_links(struct enclosure_component *cdev) if (!cdev->dev->kobj.sd) return; + if (!cdev->cdev.kobj.sd) + return; + enclosure_link_name(cdev, name); sysfs_remove_link(&cdev->dev->kobj, name); sysfs_remove_link(&cdev->cdev.kobj, "device");