]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tty: serial: msm_geni_serial: Fix return value check in qcom_geni_serial_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 22 Mar 2018 02:25:07 +0000 (02:25 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Mar 2018 17:33:44 +0000 (18:33 +0100)
In case of error, the function platform_get_resource() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Fixes: c4f528795d1a ("tty: serial: msm_geni_serial: Add serial driver support for GENI based QUP")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/qcom_geni_serial.c

index 14427778ad143f26faf7a13730ac5e110e664f92..65ff669373d4a0325ffd97a04f070ee3e389217a 100644 (file)
@@ -1053,8 +1053,8 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
        }
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (IS_ERR(res))
-               return PTR_ERR(res);
+       if (!res)
+               return -EINVAL;
        uport->mapbase = res->start;
 
        port->tx_fifo_depth = DEF_FIFO_DEPTH_WORDS;