summaryrefslogtreecommitdiff
path: root/drivers/usb/host/xhci-dbgtty.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-03-16 17:32:58 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-16 17:40:18 +0300
commit29f653393e740b159933b03de25f929bec7b31b7 (patch)
treec19bca4c96ec116e1cece26e1913e49d1be8841b /drivers/usb/host/xhci-dbgtty.c
parent95713fb8aa039e9cd89ff545b62bd2a860c36e39 (diff)
downloadlinux-29f653393e740b159933b03de25f929bec7b31b7.tar.xz
usb: xhci: Clean up error code in xhci_dbc_tty_register_device()
tty_port_register_device() returns error pointers on error, never NULL. The IS_ERR_OR_NULL() function returns either 1 or 0 so it means we return 1 on error instead of a proper error code. The caller only checks for zero vs non-zero so this doesn't affect runtime. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci-dbgtty.c')
-rw-r--r--drivers/usb/host/xhci-dbgtty.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-dbgtty.c b/drivers/usb/host/xhci-dbgtty.c
index 8d47b6fbf973..6f534b6decef 100644
--- a/drivers/usb/host/xhci-dbgtty.c
+++ b/drivers/usb/host/xhci-dbgtty.c
@@ -443,9 +443,10 @@ int xhci_dbc_tty_register_device(struct xhci_hcd *xhci)
xhci_dbc_tty_init_port(xhci, port);
tty_dev = tty_port_register_device(&port->port,
dbc_tty_driver, 0, NULL);
- ret = IS_ERR_OR_NULL(tty_dev);
- if (ret)
+ if (IS_ERR(tty_dev)) {
+ ret = PTR_ERR(tty_dev);
goto register_fail;
+ }
ret = kfifo_alloc(&port->write_fifo, DBC_WRITE_BUF_SIZE, GFP_KERNEL);
if (ret)