lkml.org 
[lkml]   [2020]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] usb: dwc2: Fix error path in gadget registration
Date
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
\
 
 \ /
  Last update: 2020-07-14 14:32    [W:1.054 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site