All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: intel: fix NULL pointer deref
@ 2021-06-09  6:27 Henning Schild
  2021-06-09 10:12 ` Mika Westerberg
  0 siblings, 1 reply; 10+ messages in thread
From: Henning Schild @ 2021-06-09  6:27 UTC (permalink / raw)
  To: linux-kernel, linux-gpio, Andy Shevchenko, Mika Westerberg
  Cc: Linus Walleij, Henning Schild

match could be NULL in which case we do not go ACPI after all

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 drivers/pinctrl/intel/pinctrl-intel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
index 85750974d182..dca17bb76cac 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -1601,12 +1601,12 @@ const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_
 	const struct intel_pinctrl_soc_data *data = NULL;
 	const struct intel_pinctrl_soc_data **table;
 	struct acpi_device *adev;
+	const void *match;
 	unsigned int i;
 
 	adev = ACPI_COMPANION(&pdev->dev);
-	if (adev) {
-		const void *match = device_get_match_data(&pdev->dev);
-
+	match = device_get_match_data(&pdev->dev);
+	if (adev && match) {
 		table = (const struct intel_pinctrl_soc_data **)match;
 		for (i = 0; table[i]; i++) {
 			if (!strcmp(adev->pnp.unique_id, table[i]->uid)) {
-- 
2.31.1


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

end of thread, other threads:[~2021-06-11 18:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09  6:27 [PATCH] pinctrl: intel: fix NULL pointer deref Henning Schild
2021-06-09 10:12 ` Mika Westerberg
2021-06-09 10:33   ` Andy Shevchenko
2021-06-09 11:08     ` Henning Schild
2021-06-10 14:25       ` Andy Shevchenko
2021-06-10 14:32         ` Andy Shevchenko
2021-06-10 14:56           ` Henning Schild
2021-06-10 15:00             ` Andy Shevchenko
2021-06-10 15:28               ` Andy Shevchenko
2021-06-11 18:19                 ` Henning Schild

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.