From: Greg KH <gregkh@linuxfoundation.org>
To: Ray Chi <raychi@google.com>
Cc: Thinh.Nguyen@synopsys.com, quic_uaggarwa@quicinc.com,
albertccwang@google.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] usb: dwc3: gadget: remove warning during kernel boot
Date: Tue, 20 Feb 2024 09:34:28 +0100 [thread overview]
Message-ID: <2024022024-trout-kennel-6d14@gregkh> (raw)
In-Reply-To: <20240220081205.135063-1-raychi@google.com>
On Tue, Feb 20, 2024 at 04:12:04PM +0800, Ray Chi wrote:
> The dwc3->gadget_driver is not initialized during the dwc3 probe
> process. This leads to a warning when the runtime power management (PM)
> attempts to suspend the gadget using dwc3_gadget_suspend().
What type of warning happens?
> This patch adds a check to prevent the warning.
>
> Cc: stable@vger.kernel.org
> Fixes: 61a348857e86 ("usb: dwc3: gadget: Fix NULL pointer dereference in dwc3_gadget_suspend")
> Signed-off-by: Ray Chi <raychi@google.com>
> ---
> drivers/usb/dwc3/gadget.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 28f49400f3e8..de987cffe1ec 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -4708,6 +4708,9 @@ int dwc3_gadget_suspend(struct dwc3 *dwc)
> unsigned long flags;
> int ret;
>
> + if (!dwc->gadget_driver)
> + return 0;
> +
This directly reverts part of the commit you say this fixes, are you
SURE about this? Why?
thanks,
greg k-h
next prev parent reply other threads:[~2024-02-20 8:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-20 8:12 [PATCH] usb: dwc3: gadget: remove warning during kernel boot Ray Chi
2024-02-20 8:20 ` Ray Chi
2024-02-20 8:39 ` Greg KH
2024-02-20 8:34 ` Greg KH [this message]
2024-02-20 8:40 ` Krishna Kurapati PSSNV
2024-02-20 9:42 ` Ray Chi
2024-02-20 13:56 ` Greg KH
2024-02-23 10:36 ` Ray Chi
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=2024022024-trout-kennel-6d14@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=Thinh.Nguyen@synopsys.com \
--cc=albertccwang@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=quic_uaggarwa@quicinc.com \
--cc=raychi@google.com \
--cc=stable@vger.kernel.org \
/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