[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <40bfbfd6-6516-5995-8250-c8e3df16e11e@synopsys.com>
Date: Tue, 14 Jul 2020 12:32:27 +0000
From: Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>
To: Marek Szyprowski <m.szyprowski@...sung.com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Felipe Balbi <balbi@...nel.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] usb: dwc2: Fix error path in gadget registration
Hi Marek,
On 7/14/2020 12:48 PM, Marek Szyprowski wrote:
> When gadget registration fails, one should not call usb_del_gadget_udc().
> Ensure this by setting gadget->udc to NULL. Also in case of a failure
I was able to reproduce issue. I'm Ok with this fix.
> there is no need to disable low-level hardware, so return immiedetly
> instead of jumping to error_init label.
>
Why do you think that disable low-level hardware not required which was
enabled before? Also for some platforms required to call
regulator_disable() which was enabled earlier in probe function.
So, I suggest to keep jump to error_init label.
> This fixes the following kernel NULL ptr dereference on gadget failure
> (can be easily triggered with g_mass_storage without any module
> parameters):
>
Thanks,
Minas
Powered by blists - more mailing lists