Re: [PATCH] usb: dwc2: Fix error path in gadget registration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux