From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: Andrew Goodbody <andrew.goodbody@linaro.org>,
Lukasz Majewski <lukma@denx.de>,
Mattijs Korpershoek <mkorpershoek@kernel.org>,
Marek Vasut <marex@denx.de>, Tom Rini <trini@konsulko.com>
Cc: Zixun LI <admin@hifiphile.com>,
u-boot@lists.denx.de,
Andrew Goodbody <andrew.goodbody@linaro.org>
Subject: Re: [PATCH] usb: gadget: atmel: Add missing null check
Date: Tue, 30 Sep 2025 09:50:09 +0200 [thread overview]
Message-ID: <87tt0kidla.fsf@kernel.org> (raw)
In-Reply-To: <20250929-atmel_usba_udc-v1-1-e1426271e12a@linaro.org>
Hi Andrew,
Thank you for the patch.
On Mon, Sep 29, 2025 at 17:25, Andrew Goodbody <andrew.goodbody@linaro.org> wrote:
> 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>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.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>
next prev parent reply other threads:[~2025-09-30 7:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2025-09-30 9:51 ` Mattijs Korpershoek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tt0kidla.fsf@kernel.org \
--to=mkorpershoek@kernel.org \
--cc=admin@hifiphile.com \
--cc=andrew.goodbody@linaro.org \
--cc=lukma@denx.de \
--cc=marex@denx.de \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox