Skip to content
Commit fb50aacd authored by Vardan Mikayelyan's avatar Vardan Mikayelyan Committed by Felipe Balbi
Browse files

usb: dwc2: pci: Move devm_kzalloc() before platform_device_add()



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 avoid calling of
platform_device_unregister().

Acked-by: default avatarJohn Youn <johnyoun@synopsys.com>
Signed-off-by: default avatarVardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
Signed-off-by: default avatarGrigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent a127cccd
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment