summaryrefslogtreecommitdiff
path: root/drivers/usb/usbip
diff options
context:
space:
mode:
authorWei Yongjun <weiyj.lk@gmail.com>2016-08-12 11:22:22 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-15 16:25:59 +0200
commit6e958051cb0742dd54bb61528c130bd6eaecae0d (patch)
treee327c5002cfbfa1b6d372362b6d41e35bdf624ac /drivers/usb/usbip
parentd35cbed6047c0207b4be9ff60b541c331b62b59c (diff)
usbip: vhci_hcd: fix return value check in add_platform_device()
In case of error, the function platform_device_register_simple() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/usbip')
-rw-r--r--drivers/usb/usbip/vhci_hcd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
index 96f2dacb27fa..03eccf29ace0 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -1211,8 +1211,8 @@ static int add_platform_device(int id)
dev_nr = id;
pdev = platform_device_register_simple(driver_name, dev_nr, NULL, 0);
- if (pdev == NULL)
- return -ENODEV;
+ if (IS_ERR(pdev))
+ return PTR_ERR(pdev);
*(vhci_pdevs + id) = pdev;
return 0;