Skip to content

Commit

Permalink
tty: serial: msm_geni_serial: Fix return value check in qcom_geni_ser…
Browse files Browse the repository at this point in the history
…ial_probe()

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: c4f5287 ("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>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Mar 22, 2018
1 parent 4958134 commit 7693b33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/tty/serial/qcom_geni_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7693b33

Please sign in to comment.