mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-17 20:54:10 +00:00
serial: liteuart: fix return value check in liteuart_probe()
In case of error, the function devm_platform_get_and_ioremap_resource()
returns ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().
Fixes: 1da81e5562
("drivers/tty/serial: add LiteUART driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210305034929.3234352-1-weiyongjun1@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
81171e7d31
commit
cebeddd6d0
1 changed files with 2 additions and 2 deletions
|
@ -270,8 +270,8 @@ static int liteuart_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
/* get membase */
|
/* get membase */
|
||||||
port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
|
port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
|
||||||
if (!port->membase)
|
if (IS_ERR(port->membase))
|
||||||
return -ENXIO;
|
return PTR_ERR(port->membase);
|
||||||
|
|
||||||
/* values not from device tree */
|
/* values not from device tree */
|
||||||
port->dev = &pdev->dev;
|
port->dev = &pdev->dev;
|
||||||
|
|
Loading…
Add table
Reference in a new issue