summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZijun Hu <quic_zijuhu@quicinc.com>2024-08-20 14:01:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-09-04 14:17:47 +0300
commit4538335cc23ddc01dfe39e3a28b6337bc876287f (patch)
tree0285d1c3ef5226e5c67278ba5b4fc60bd776fb1c
parent59579a627adbe34a8b8dfbb226cc164ae8f7c19a (diff)
downloadlinux-4538335cc23ddc01dfe39e3a28b6337bc876287f.tar.xz
usb: core: sysfs: Unmerge @usb3_hardware_lpm_attr_group in remove_power_attributes()
commit 3a8839bbb86da7968a792123ed2296d063871a52 upstream. Device attribute group @usb3_hardware_lpm_attr_group is merged by add_power_attributes(), but it is not unmerged explicitly, fixed by unmerging it in remove_power_attributes(). Fixes: 655fe4effe0f ("usbcore: add sysfs support to xHCI usb3 hardware LPM") Cc: stable@vger.kernel.org Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Link: https://lore.kernel.org/r/20240820-sysfs_fix-v2-1-a9441487077e@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/core/sysfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 366c09521785..d93a02e6050b 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -667,6 +667,7 @@ static int add_power_attributes(struct device *dev)
static void remove_power_attributes(struct device *dev)
{
+ sysfs_unmerge_group(&dev->kobj, &usb3_hardware_lpm_attr_group);
sysfs_unmerge_group(&dev->kobj, &usb2_hardware_lpm_attr_group);
sysfs_unmerge_group(&dev->kobj, &power_attr_group);
}