lab.nexedi.com will be down from Thursday, 20 March 2025, 07:30:00 UTC for a duration of approximately 2 hours

Commit d28eae1d authored by Gregory CLEMENT's avatar Gregory CLEMENT Committed by Sasha Levin

usb: gadget: atmel_usba: fix crashed during stopping when DEBUG is enabled

commit 511f3c53 (usb: gadget: udc-core: fix a regression during gadget driver
unbinding) introduced a crash when DEBUG is enabled.

The debug trace in the atmel_usba_stop function made the assumption that the
driver pointer passed in parameter was not NULL, but since the commit above,
such assumption was no longer always true.

This commit now uses the driver pointer stored in udc which fixes this
issue.

[ balbi@ti.com : improved commit log a bit ]

Cc: <stable@vger.kernel.org> # v3.2+
Acked-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>

(cherry picked from commit d8eb6c65)
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent ab2350d5
......@@ -1841,13 +1841,13 @@ static int atmel_usba_stop(struct usb_gadget *gadget,
toggle_bias(0);
usba_writel(udc, CTRL, USBA_DISABLE_MASK);
udc->gadget.dev.driver = NULL;
udc->driver = NULL;
clk_disable(udc->hclk);
clk_disable(udc->pclk);
DBG(DBG_GADGET, "unregistered driver `%s'\n", driver->driver.name);
DBG(DBG_GADGET, "unregistered driver `%s'\n", udc->driver->driver.name);
udc->gadget.dev.driver = NULL;
udc->driver = NULL;
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment