From: James Bottomley Date: Fri, 15 Nov 2013 22:58:00 +0000 (-0800) Subject: enclosure: fix WARN_ON in dual path device removing X-Git-Tag: v3.2.54~72 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61e5e44d5f275afec7ddcf02c83537b664b25195;p=pandora-kernel.git enclosure: fix WARN_ON in dual path device removing commit a1470c7bf3a4676e62e4c0fb204e339399eb5c59 upstream. Bug report from: wenxiong@linux.vnet.ibm.com The issue is happened in dual controller configuration. We got the sysfs warnings when rmmod the ipr module. enclosure_unregister() in drivers/msic/enclosure.c, call device_unregister() for each componment deivce, device_unregister() ->device_del()->kobject_del() ->sysfs_remove_dir(). In sysfs_remove_dir(), set kobj->sd = NULL. For each componment device, enclosure_component_release()->enclosure_remove_links()->sysfs_remove_link() in which checking kobj->sd again, it has been set as NULL when doing device_unregister. So we saw all these sysfs WARNING. Tested-by: wenxiong@linux.vnet.ibm.com Signed-off-by: James Bottomley Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed