diff options
| author | Krzysztof Kozlowski <k.kozlowski.k@gmail.com> | 2015-07-09 09:21:41 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-23 18:05:53 -0400 |
| commit | 97a60eac33f663d2150ee1b3c69253d87ba53dff (patch) | |
| tree | 14465d948b30395805aec179f4970bb42118759a | |
| parent | 3b19e032295647b7be2aa3be62510db4aaeda759 (diff) | |
serial: amba-pl011: Fix devm_ioremap_resource return value check
Value returned by devm_ioremap_resource() was checked for non-NULL but
devm_ioremap_resource() returns IOMEM_ERR_PTR, not NULL. In case of
error this could lead to dereference of ERR_PTR.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Cc: <stable@vger.kernel.org>
Fixes: 3873e2d7f63a ("drivers: PL011: refactor pl011_probe()")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/tty/serial/amba-pl011.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 50cf5b10ceed..fd27e986b1dd 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c | |||
| @@ -2310,8 +2310,8 @@ static int pl011_setup_port(struct device *dev, struct uart_amba_port *uap, | |||
| 2310 | void __iomem *base; | 2310 | void __iomem *base; |
| 2311 | 2311 | ||
| 2312 | base = devm_ioremap_resource(dev, mmiobase); | 2312 | base = devm_ioremap_resource(dev, mmiobase); |
| 2313 | if (!base) | 2313 | if (IS_ERR(base)) |
| 2314 | return -ENOMEM; | 2314 | return PTR_ERR(base); |
| 2315 | 2315 | ||
| 2316 | index = pl011_probe_dt_alias(index, dev); | 2316 | index = pl011_probe_dt_alias(index, dev); |
| 2317 | 2317 | ||
