Re: [PATCH] usb: dwc2: pci: Fix error handling in dwc2_pci_probe

2017-02-17 Thread Janusz Dziedzic
On 17 February 2017 at 14:01, Vardan Mikayelyan wrote: > Move usb_phy_generic_register() function call to the top, to simplify > error handling. > > Replace kzalloc() with devm_kzalloc(). > > After platform_device_add(), if we error out, we must do >

[PATCH] usb: dwc2: pci: Fix error handling in dwc2_pci_probe

2017-02-17 Thread Vardan Mikayelyan
Move usb_phy_generic_register() function call to the top, to simplify error handling. Replace kzalloc() with devm_kzalloc(). After platform_device_add(), if we error out, we must do platform_device_unregister(), which also does the put. So lets move devm_kzalloc() to simplify error handling and