mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RESEND PATCH v1] i2c: i2c-stm32f7: fix no check on returned setup
@ 2018-03-12 12:53 Pierre-Yves MORDRET
  2018-03-17 20:44 ` Wolfram Sang
  2018-03-20  9:08 ` Alexandre Torgue
  0 siblings, 2 replies; 4+ messages in thread
From: Pierre-Yves MORDRET @ 2018-03-12 12:53 UTC (permalink / raw)
  To: Wolfram Sang, Maxime Coquelin, Alexandre Torgue, linux-i2c,
	linux-arm-kernel, linux-kernel
  Cc: Pierre-Yves MORDRET

Before assigning returned setup structure check if not null

Fixes: 463a9215f3ca7600b5ff ("i2c: stm32f7: fix setup structure")
Signed-off-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
---
  Version history:
     v1:
         * Initial
---
---
 drivers/i2c/busses/i2c-stm32f7.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index b445b3b..16c7d77 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -888,6 +888,10 @@ static int stm32f7_i2c_probe(struct platform_device *pdev)
 	}
 
 	setup = of_device_get_match_data(&pdev->dev);
+	if (!setup) {
+		dev_err(&pdev->dev, "Can't get device data\n");
+		goto clk_free;
+	}
 	i2c_dev->setup = *setup;
 
 	ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-rising-time-ns",
-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [RESEND PATCH v1] i2c: i2c-stm32f7: fix no check on returned setup
@ 2018-02-27  9:47 Pierre-Yves MORDRET
  0 siblings, 0 replies; 4+ messages in thread
From: Pierre-Yves MORDRET @ 2018-02-27  9:47 UTC (permalink / raw)
  To: Wolfram Sang, Maxime Coquelin, Alexandre Torgue, linux-i2c,
	linux-arm-kernel, linux-kernel
  Cc: Pierre-Yves MORDRET

Before assigning returned setup structure check if not null

Fixes: 463a9215f3ca7600b5ff ("i2c: stm32f7: fix setup structure")
Signed-off-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
---
  Version history:
     v1:
         * Initial
---
---
 drivers/i2c/busses/i2c-stm32f7.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index b445b3b..16c7d77 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -888,6 +888,10 @@ static int stm32f7_i2c_probe(struct platform_device *pdev)
 	}
 
 	setup = of_device_get_match_data(&pdev->dev);
+	if (!setup) {
+		dev_err(&pdev->dev, "Can't get device data\n");
+		goto clk_free;
+	}
 	i2c_dev->setup = *setup;
 
 	ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-rising-time-ns",
-- 
2.7.4

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

end of thread, other threads:[~2018-03-20  9:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-12 12:53 [RESEND PATCH v1] i2c: i2c-stm32f7: fix no check on returned setup Pierre-Yves MORDRET
2018-03-17 20:44 ` Wolfram Sang
2018-03-20  9:08 ` Alexandre Torgue
  -- strict thread matches above, loose matches on Subject: below --
2018-02-27  9:47 Pierre-Yves MORDRET

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®