[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190318230430.8273-1-pakki001@umn.edu>
Date: Mon, 18 Mar 2019 18:04:30 -0500
From: Aditya Pakki <pakki001@....edu>
To: pakki001@....edu
Cc: kjlu@....edu, Sudeep Holla <sudeep.holla@....com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] firmware: arm_scmi: Fix to check return value of of_match_device
of_match_device can return NULL if no matching device is found. This patch
checks and returns -ENODEV in such a scenario.
Signed-off-by: Aditya Pakki <pakki001@....edu>
---
drivers/firmware/arm_scmi/driver.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 8f952f2f1a29..0e0330b44b7b 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -799,6 +799,8 @@ static int scmi_probe(struct platform_device *pdev)
}
desc = of_match_device(scmi_of_match, dev)->data;
+ if (!desc)
+ return -ENODEV;
info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
if (!info)
--
2.17.1
Powered by blists - more mailing lists