All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] i2c: i2c-stm32f7: fix no check on returned setup
@ 2018-03-21 16:48 ` Pierre-Yves MORDRET
  0 siblings, 0 replies; 8+ messages in thread
From: Pierre-Yves MORDRET @ 2018-03-21 16:48 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
     v2:
         * fill "ret" with error statement before go to "clk_free"
---
---
 drivers/i2c/busses/i2c-stm32f7.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index b445b3b..f273e28 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -888,6 +888,11 @@ 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");
+		ret = -ENODEV;
+		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 related	[flat|nested] 8+ messages in thread

* [PATCH v2] i2c: i2c-stm32f7: fix no check on returned setup
@ 2018-03-21 16:48 ` Pierre-Yves MORDRET
  0 siblings, 0 replies; 8+ messages in thread
From: Pierre-Yves MORDRET @ 2018-03-21 16:48 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
     v2:
         * fill "ret" with error statement before go to "clk_free"
---
---
 drivers/i2c/busses/i2c-stm32f7.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index b445b3b..f273e28 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -888,6 +888,11 @@ 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");
+		ret = -ENODEV;
+		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 related	[flat|nested] 8+ messages in thread

* [PATCH v2] i2c: i2c-stm32f7: fix no check on returned setup
@ 2018-03-21 16:48 ` Pierre-Yves MORDRET
  0 siblings, 0 replies; 8+ messages in thread
From: Pierre-Yves MORDRET @ 2018-03-21 16:48 UTC (permalink / raw)
  To: linux-arm-kernel

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
     v2:
         * fill "ret" with error statement before go to "clk_free"
---
---
 drivers/i2c/busses/i2c-stm32f7.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index b445b3b..f273e28 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -888,6 +888,11 @@ 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");
+		ret = -ENODEV;
+		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 related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] i2c: i2c-stm32f7: fix no check on returned setup
  2018-03-21 16:48 ` Pierre-Yves MORDRET
  (?)
@ 2018-03-22  8:33   ` Alexandre Torgue
  -1 siblings, 0 replies; 8+ messages in thread
From: Alexandre Torgue @ 2018-03-22  8:33 UTC (permalink / raw)
  To: Pierre-Yves MORDRET, Wolfram Sang, Maxime Coquelin, linux-i2c,
	linux-arm-kernel, linux-kernel



On 03/21/2018 05:48 PM, Pierre-Yves MORDRET wrote:
> 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
>       v2:
>           * fill "ret" with error statement before go to "clk_free"
> ---
> ---
>   drivers/i2c/busses/i2c-stm32f7.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
> index b445b3b..f273e28 100644
> --- a/drivers/i2c/busses/i2c-stm32f7.c
> +++ b/drivers/i2c/busses/i2c-stm32f7.c
> @@ -888,6 +888,11 @@ 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");
> +		ret = -ENODEV;
> +		goto clk_free;
> +	}
>   	i2c_dev->setup = *setup;
>   
>   	ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-rising-time-ns",
> 
Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>

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

* Re: [PATCH v2] i2c: i2c-stm32f7: fix no check on returned setup
@ 2018-03-22  8:33   ` Alexandre Torgue
  0 siblings, 0 replies; 8+ messages in thread
From: Alexandre Torgue @ 2018-03-22  8:33 UTC (permalink / raw)
  To: Pierre-Yves MORDRET, Wolfram Sang, Maxime Coquelin, linux-i2c,
	linux-arm-kernel, linux-kernel



On 03/21/2018 05:48 PM, Pierre-Yves MORDRET wrote:
> 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
>       v2:
>           * fill "ret" with error statement before go to "clk_free"
> ---
> ---
>   drivers/i2c/busses/i2c-stm32f7.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
> index b445b3b..f273e28 100644
> --- a/drivers/i2c/busses/i2c-stm32f7.c
> +++ b/drivers/i2c/busses/i2c-stm32f7.c
> @@ -888,6 +888,11 @@ 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");
> +		ret = -ENODEV;
> +		goto clk_free;
> +	}
>   	i2c_dev->setup = *setup;
>   
>   	ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-rising-time-ns",
> 
Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>

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

* [PATCH v2] i2c: i2c-stm32f7: fix no check on returned setup
@ 2018-03-22  8:33   ` Alexandre Torgue
  0 siblings, 0 replies; 8+ messages in thread
From: Alexandre Torgue @ 2018-03-22  8:33 UTC (permalink / raw)
  To: linux-arm-kernel



On 03/21/2018 05:48 PM, Pierre-Yves MORDRET wrote:
> 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
>       v2:
>           * fill "ret" with error statement before go to "clk_free"
> ---
> ---
>   drivers/i2c/busses/i2c-stm32f7.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
> index b445b3b..f273e28 100644
> --- a/drivers/i2c/busses/i2c-stm32f7.c
> +++ b/drivers/i2c/busses/i2c-stm32f7.c
> @@ -888,6 +888,11 @@ 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");
> +		ret = -ENODEV;
> +		goto clk_free;
> +	}
>   	i2c_dev->setup = *setup;
>   
>   	ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-rising-time-ns",
> 
Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>

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

* Re: [PATCH v2] i2c: i2c-stm32f7: fix no check on returned setup
  2018-03-21 16:48 ` Pierre-Yves MORDRET
@ 2018-03-24 12:38   ` Wolfram Sang
  -1 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2018-03-24 12:38 UTC (permalink / raw)
  To: Pierre-Yves MORDRET
  Cc: Maxime Coquelin, Alexandre Torgue, linux-i2c, linux-arm-kernel,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

On Wed, Mar 21, 2018 at 05:48:40PM +0100, Pierre-Yves MORDRET wrote:
> 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>

Applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [PATCH v2] i2c: i2c-stm32f7: fix no check on returned setup
@ 2018-03-24 12:38   ` Wolfram Sang
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2018-03-24 12:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 21, 2018 at 05:48:40PM +0100, Pierre-Yves MORDRET wrote:
> 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>

Applied to for-current, thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180324/4e1aac23/attachment.sig>

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

end of thread, other threads:[~2018-03-24 12:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-21 16:48 [PATCH v2] i2c: i2c-stm32f7: fix no check on returned setup Pierre-Yves MORDRET
2018-03-21 16:48 ` Pierre-Yves MORDRET
2018-03-21 16:48 ` Pierre-Yves MORDRET
2018-03-22  8:33 ` Alexandre Torgue
2018-03-22  8:33   ` Alexandre Torgue
2018-03-22  8:33   ` Alexandre Torgue
2018-03-24 12:38 ` Wolfram Sang
2018-03-24 12:38   ` Wolfram Sang

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.