Commit 64b15106 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman
Browse files

serial: 8250_bcm7271: Fix return value check in brcmuart_probe()



In case of error, the function devm_ioremap() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.

Fixes: 41a46948 ("serial: 8250: Add new 8250-core based Broadcom STB driver")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Reviewed-by: default avatarAl Cooper <alcooperx@gmail.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210329140659.1832950-1-weiyongjun1@huawei.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 211b4d42
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -974,8 +974,8 @@ static int brcmuart_probe(struct platform_device *pdev)
			break;
		priv->regs[x] =	devm_ioremap(dev, regs->start,
					     resource_size(regs));
		if (IS_ERR(priv->regs[x]))
			return PTR_ERR(priv->regs[x]);
		if (!priv->regs[x])
			return -ENOMEM;
		if (x == REGS_8250) {
			mapbase = regs->start;
			membase = priv->regs[x];