aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/enclosure.c
diff options
context:
space:
mode:
authorLinus Walleij <[email protected]>2013-12-09 13:04:37 +0000
committerLinus Walleij <[email protected]>2013-12-09 13:04:37 +0000
commitbdc54ef45d7670aeb52ce73f8b7ad5f3e5563661 (patch)
treeda6e170ce87891a0242de88d8d7c1ba34faf9bb7 /drivers/misc/enclosure.c
parentMerge branch 'mark-irqs' into devel (diff)
parentLinux 3.13-rc3 (diff)
downloadkernel-bdc54ef45d7670aeb52ce73f8b7ad5f3e5563661.tar.gz
kernel-bdc54ef45d7670aeb52ce73f8b7ad5f3e5563661.zip
Merge tag 'v3.13-rc3' into devel
Linux 3.13-rc3
Diffstat (limited to 'drivers/misc/enclosure.c')
-rw-r--r--drivers/misc/enclosure.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c
index 0e8df41aaf14..2cf2bbc0b927 100644
--- a/drivers/misc/enclosure.c
+++ b/drivers/misc/enclosure.c
@@ -198,6 +198,13 @@ static void enclosure_remove_links(struct enclosure_component *cdev)
{
char name[ENCLOSURE_NAME_SIZE];
+ /*
+ * In odd circumstances, like multipath devices, something else may
+ * already have removed the links, so check for this condition first.
+ */
+ if (!cdev->dev->kobj.sd)
+ return;
+
enclosure_link_name(cdev, name);
sysfs_remove_link(&cdev->dev->kobj, name);
sysfs_remove_link(&cdev->cdev.kobj, "device");