summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorPetr Cvek <petr.cvek@tul.cz>2017-02-24 02:54:56 +0100
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-03-06 16:00:24 +0100
commitdf7545719a14fa7b481896fb8689e23d0a00f682 (patch)
tree2cb2464f6e928f121ec5fa3bb565207caa6fa844 /drivers/usb
parentusb: dwc3-omap: Fix missing break in dwc3_omap_set_mailbox() (diff)
downloadlinux-df7545719a14fa7b481896fb8689e23d0a00f682.tar.xz
linux-df7545719a14fa7b481896fb8689e23d0a00f682.zip
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: Robert Jarzmik <robert.jarzmik@free.fr> Reported-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Petr Cvek <petr.cvek@tul.cz> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/udc/pxa27x_udc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
index e1335ad5bce9..832c4fdbe985 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.c
+++ b/drivers/usb/gadget/udc/pxa27x_udc.c
@@ -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;