From: Benjamin Herrenschmidt Date: Mon, 6 Oct 2014 19:17:51 +0000 (-0500) Subject: ipmi/of: Don't use unavailable interfaces X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=08dc41696ad7f3f8bcb2ea8cb97935a6e79a1bd7;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git ipmi/of: Don't use unavailable interfaces If an IPMI controller is used by the firmware and as such marked with a reserved status, we shouldn't use it. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Corey Minyard Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 5d665680ae33..4fc89310bfb5 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -2658,6 +2658,9 @@ static int ipmi_probe(struct platform_device *dev) if (!match) return -EINVAL; + if (!of_device_is_available(np)) + return -EINVAL; + ret = of_address_to_resource(np, 0, &resource); if (ret) { dev_warn(&dev->dev, PFX "invalid address from OF\n");