]> Git Repo - linux.git/commitdiff
serial: 8250_bcm7271: Fix return value check in brcmuart_probe()
authorWei Yongjun <[email protected]>
Mon, 29 Mar 2021 14:06:59 +0000 (14:06 +0000)
committerGreg Kroah-Hartman <[email protected]>
Fri, 2 Apr 2021 14:12:14 +0000 (16:12 +0200)
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: 41a469482de2 ("serial: 8250: Add new 8250-core based Broadcom STB driver")
Reported-by: Hulk Robot <[email protected]>
Reviewed-by: Al Cooper <[email protected]>
Signed-off-by: Wei Yongjun <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/tty/serial/8250/8250_bcm7271.c

index 63883185fccd06ffc07f908db6964a3658f30554..a4f3f6301d4fb113d7f64cb6ea3c5d389df319c0 100644 (file)
@@ -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];
This page took 0.050694 seconds and 4 git commands to generate.