Skip to contentSkip to conversation

usb: sl811-hcd: disable controller wakeup on remove

PATCH New Myeonghun Pak 1 participant 1 message Jul 1

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: sl811-hcd: disable controller wakeup on remove

sl811h_probe() enables the HCD controller device as a wakeup source after usb_add_hcd() succeeds, but sl811h_remove() removes the HCD and releases the driver resources without disabling that wakeup source.

Disable controller wakeup after usb_remove_hcd() and before usb_put_hcd() so the wakeup source object is detached while the controller device pointer is still available.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes 3c9740a117d4 ("usb: hcd: move controller wakeup setting initialization to individual driver")
---
 drivers/usb/host/sl811-hcd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/host/sl811-hcd.c +1 -0
index 4ae47edd4b8b..b044977f6f56 100644
@@ -1591,6 +1591,7 @@ sl811h_remove(struct platform_device *dev)
 
 	remove_debug_file(sl811);
 	usb_remove_hcd(hcd);
+	device_wakeup_disable(hcd->self.controller);
 
 	/* some platforms may use IORESOURCE_IO */
 	res = platform_get_resource(dev, IORESOURCE_MEM, 1);
Signature · 1 line
2.47.1