U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
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: Junhui Liu <junhui.liu@pigmoral.tech>,
	Kongyang Liu <seashell11234455@gmail.com>,
	u-boot@lists.denx.de,
	Andrew Goodbody <andrew.goodbody@linaro.org>
Subject: Re: [PATCH] usb: dwc2: Add missing null check
Date: Tue, 30 Sep 2025 09:51:43 +0200	[thread overview]
Message-ID: <87qzvoidio.fsf@kernel.org> (raw)
In-Reply-To: <20250929-usb_dwc2-v1-1-863133dcbcde@linaro.org>

Hi Andrew,

Thank you for the patch.

On Mon, Sep 29, 2025 at 17:40, Andrew Goodbody <andrew.goodbody@linaro.org> wrote:

> Add in the missing null check for dev->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/dwc2_udc_otg_xfer_dma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
> index fca052b4556a7d2ae4fe516e39820611d7082e2f..5a7f50ebaa5579f67ea5dc9491d0d1f4d4b81ea1 100644
> --- a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
> +++ b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
> @@ -526,7 +526,7 @@ static int dwc2_udc_irq(int irq, void *_dev)
>  		if (gotgint & GOTGINT_SES_END_DET) {
>  			debug_cond(DEBUG_ISR, "\t\tSession End Detected\n");
>  			/* Let gadget detect disconnected state */
> -			if (dev->driver->disconnect) {
> +			if (dev->driver && dev->driver->disconnect) {
>  				spin_unlock_irqrestore(&dev->lock, flags);
>  				dev->driver->disconnect(&dev->gadget);
>  				spin_lock_irqsave(&dev->lock, flags);
>
> ---
> base-commit: 9710d98e8942151fc0c62d54100d9d27e8263d04
> change-id: 20250929-usb_dwc2-924d0d26df62
>
> Best regards,
> -- 
> Andrew Goodbody <andrew.goodbody@linaro.org>

  parent reply	other threads:[~2025-09-30  7:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-29 16:40 [PATCH] usb: dwc2: Add missing null check Andrew Goodbody
2025-09-29 23:05 ` Marek Vasut
2025-09-30  7:51 ` Mattijs Korpershoek [this message]
2025-09-30  9:54 ` 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=87qzvoidio.fsf@kernel.org \
    --to=mkorpershoek@kernel.org \
    --cc=andrew.goodbody@linaro.org \
    --cc=junhui.liu@pigmoral.tech \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=seashell11234455@gmail.com \
    --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