Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97a60eac authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Greg Kroah-Hartman
Browse files

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: default avatarKrzysztof Kozlowski <k.kozlowski.k@gmail.com>
Cc: <stable@vger.kernel.org>
Fixes: 3873e2d7 ("drivers: PL011: refactor pl011_probe()")
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3b19e032
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2310,8 +2310,8 @@ static int pl011_setup_port(struct device *dev, struct uart_amba_port *uap,
	void __iomem *base;

	base = devm_ioremap_resource(dev, mmiobase);
	if (!base)
		return -ENOMEM;
	if (IS_ERR(base))
		return PTR_ERR(base);

	index = pl011_probe_dt_alias(index, dev);