]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
usb: renesas_usbhs: Flush the notify_hotplug_work
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tue, 25 Feb 2025 11:02:48 +0000 (13:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 12:02:11 +0000 (13:02 +0100)
commit 552ca6b87e3778f3dd5b87842f95138162e16c82 upstream.

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: bc57381e6347 ("usb: renesas_usbhs: use delayed_work instead of work_struct")
Cc: stable <stable@kernel.org>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Claudiu 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/renesas_usbhs/common.c

index 8d7493968bd89609ee59f5d1368b674f853af24d..7324de52d9505e1da9c0a076160be005a71f34a3 100644 (file)
@@ -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);