Re: [PATCH] usb: dwc3: Flip condition guarding power_supply_put()

From: Greg Kroah-Hartman
Date: Thu Mar 04 2021 - 03:23:40 EST


On Wed, Mar 03, 2021 at 11:26:14AM -0800, Bjorn Andersson wrote:
> The condition guarding the power_supply_put() calls in error and
> removal paths are backwards, resulting in a guaranteed NULL pointer
> dereference if no power supply was acquired.
>
> Fixes: 59fa3def35de ("usb: dwc3: add a power supply for current control")
> Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>
> ---
> drivers/usb/dwc3/core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Already fixed:
d05a12f0478c ("usb: dwc3: Fix dereferencing of null dwc->usb_psy")

thanks,

greg k-h