Commit df754571 authored by Petr Cvek's avatar Petr Cvek Committed by Felipe Balbi

usb: gadget: pxa27x: Test for a valid argument pointer

A call usb_put_phy(udc->transceiver) must be tested for a valid pointer.
Use an already existing test for usb_unregister_notifier call.
Acked-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Reported-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarPetr Cvek <petr.cvek@tul.cz>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 0913750f
......@@ -2534,9 +2534,10 @@ static int pxa_udc_remove(struct platform_device *_dev)
usb_del_gadget_udc(&udc->gadget);
pxa_cleanup_debugfs(udc);
if (!IS_ERR_OR_NULL(udc->transceiver))
if (!IS_ERR_OR_NULL(udc->transceiver)) {
usb_unregister_notifier(udc->transceiver, &pxa27x_udc_phy);
usb_put_phy(udc->transceiver);
usb_put_phy(udc->transceiver);
}
udc->transceiver = NULL;
the_controller = NULL;
......
Markdown is supported
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