All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: atmel: Add missing null check
@ 2025-09-29 16:25 Andrew Goodbody
  2025-09-29 23:05 ` Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrew Goodbody @ 2025-09-29 16:25 UTC (permalink / raw)
  To: Lukasz Majewski, Mattijs Korpershoek, Marek Vasut, Tom Rini
  Cc: Zixun LI, u-boot, Andrew Goodbody

Add in the missing null check for udc->driver that is present at other
points in the function before it is dereferenced.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
---
 drivers/usb/gadget/atmel_usba_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index 72f68dba3a741b7f0aac8ba89b83eefb5e0cce4f..f7a92ded6dab187475249874db37d81a07bf5b9e 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1147,7 +1147,7 @@ static int usba_udc_irq(struct usba_udc *udc)
 		reset_all_endpoints(udc);
 
 		if (udc->gadget.speed != USB_SPEED_UNKNOWN &&
-		    udc->driver->disconnect) {
+		    udc->driver && udc->driver->disconnect) {
 			udc->gadget.speed = USB_SPEED_UNKNOWN;
 			spin_unlock(&udc->lock);
 			udc->driver->disconnect(&udc->gadget);

---
base-commit: 9710d98e8942151fc0c62d54100d9d27e8263d04
change-id: 20250929-atmel_usba_udc-046059597928

Best regards,
-- 
Andrew Goodbody <andrew.goodbody@linaro.org>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-30  9:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-29 16:25 [PATCH] usb: gadget: atmel: Add missing null check Andrew Goodbody
2025-09-29 23:05 ` Marek Vasut
2025-09-30  7:50 ` Mattijs Korpershoek
2025-09-30  9:51 ` Mattijs Korpershoek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.