mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] firmware: arm_scmi: Fix to check return value of of_match_device
@ 2019-03-18 23:04 Aditya Pakki
  2019-03-22 16:44 ` Steven Price
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2019-03-18 23:04 UTC (permalink / raw)
  To: pakki001; +Cc: kjlu, Sudeep Holla, linux-arm-kernel, linux-kernel

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@umn.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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-22 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-18 23:04 [PATCH] firmware: arm_scmi: Fix to check return value of of_match_device Aditya Pakki
2019-03-22 16:44 ` Steven Price

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®