Commit 552ca6b8 authored by Claudiu Beznea's avatar Claudiu Beznea Committed by Greg Kroah-Hartman
Browse files

usb: renesas_usbhs: Flush the notify_hotplug_work



When performing continuous unbind/bind operations on the USB drivers
available on the Renesas RZ/G2L SoC, a kernel crash with the message
"Unable to handle kernel NULL pointer dereference at virtual address"
may occur. This issue points to the usbhsc_notify_hotplug() function.

Flush the delayed work to avoid its execution when driver resources are
unavailable.

Fixes: bc57381e ("usb: renesas_usbhs: use delayed_work instead of work_struct")
Cc: stable <stable@kernel.org>
Reviewed-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://lore.kernel.org/r/20250225110248.870417-4-claudiu.beznea.uj@bp.renesas.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e0c92440
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -781,6 +781,8 @@ static void usbhs_remove(struct platform_device *pdev)

	dev_dbg(&pdev->dev, "usb remove\n");

	flush_delayed_work(&priv->notify_hotplug_work);

	/* power off */
	if (!usbhs_get_dparam(priv, runtime_pwctrl))
		usbhsc_power_ctrl(priv, 0);