All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-24  8:21 ` Miaoqian Lin
  0 siblings, 0 replies; 25+ messages in thread
From: Miaoqian Lin @ 2021-12-24  8:21 UTC (permalink / raw)
  Cc: linmq006, Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun,
	Kishon Vijay Abraham I, Vinod Koul, Matthias Brugger, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-phy, linux-kernel

The of_device_get_match_data() function may return NULL.
Add check to prevent potential null dereference.

Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
index 28ad9403c441..67b005d5b9e3 100644
--- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
+++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
@@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	mipi_tx->driver_data = of_device_get_match_data(dev);
+	if (!mipi_tx->driver_data)
+		return -ENODEV;
 
 	mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mipi_tx->regs))
-- 
2.17.1


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

* [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-24  8:21 ` Miaoqian Lin
  0 siblings, 0 replies; 25+ messages in thread
From: Miaoqian Lin @ 2021-12-24  8:21 UTC (permalink / raw)
  Cc: linmq006, Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun,
	Kishon Vijay Abraham I, Vinod Koul, Matthias Brugger, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-phy, linux-kernel

The of_device_get_match_data() function may return NULL.
Add check to prevent potential null dereference.

Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
index 28ad9403c441..67b005d5b9e3 100644
--- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
+++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
@@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	mipi_tx->driver_data = of_device_get_match_data(dev);
+	if (!mipi_tx->driver_data)
+		return -ENODEV;
 
 	mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mipi_tx->regs))
-- 
2.17.1


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-24  8:21 ` Miaoqian Lin
  0 siblings, 0 replies; 25+ messages in thread
From: Miaoqian Lin @ 2021-12-24  8:21 UTC (permalink / raw)
  Cc: Chun-Kuang Hu, linmq006, linux-phy, linux-kernel, dri-devel,
	Kishon Vijay Abraham I, Matthias Brugger, Vinod Koul,
	linux-mediatek, Chunfeng Yun, linux-arm-kernel

The of_device_get_match_data() function may return NULL.
Add check to prevent potential null dereference.

Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
index 28ad9403c441..67b005d5b9e3 100644
--- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
+++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
@@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	mipi_tx->driver_data = of_device_get_match_data(dev);
+	if (!mipi_tx->driver_data)
+		return -ENODEV;
 
 	mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mipi_tx->regs))
-- 
2.17.1


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

* [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-24  8:21 ` Miaoqian Lin
  0 siblings, 0 replies; 25+ messages in thread
From: Miaoqian Lin @ 2021-12-24  8:21 UTC (permalink / raw)
  Cc: linmq006, Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun,
	Kishon Vijay Abraham I, Vinod Koul, Matthias Brugger, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-phy, linux-kernel

The of_device_get_match_data() function may return NULL.
Add check to prevent potential null dereference.

Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
index 28ad9403c441..67b005d5b9e3 100644
--- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
+++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
@@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	mipi_tx->driver_data = of_device_get_match_data(dev);
+	if (!mipi_tx->driver_data)
+		return -ENODEV;
 
 	mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mipi_tx->regs))
-- 
2.17.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-24  8:21 ` Miaoqian Lin
  0 siblings, 0 replies; 25+ messages in thread
From: Miaoqian Lin @ 2021-12-24  8:21 UTC (permalink / raw)
  Cc: linmq006, Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun,
	Kishon Vijay Abraham I, Vinod Koul, Matthias Brugger, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-phy, linux-kernel

The of_device_get_match_data() function may return NULL.
Add check to prevent potential null dereference.

Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
index 28ad9403c441..67b005d5b9e3 100644
--- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
+++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
@@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	mipi_tx->driver_data = of_device_get_match_data(dev);
+	if (!mipi_tx->driver_data)
+		return -ENODEV;
 
 	mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mipi_tx->regs))
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
  2021-12-24  8:21 ` Miaoqian Lin
                     ` (2 preceding siblings ...)
  (?)
@ 2021-12-24  9:55   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 25+ messages in thread
From: AngeloGioacchino Del Regno @ 2021-12-24  9:55 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun,
	Kishon Vijay Abraham I, Vinod Koul, Matthias Brugger, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-phy, linux-kernel

Il 24/12/21 09:21, Miaoqian Lin ha scritto:
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
> 
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-24  9:55   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 25+ messages in thread
From: AngeloGioacchino Del Regno @ 2021-12-24  9:55 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, linux-phy, linux-kernel, dri-devel,
	Kishon Vijay Abraham I, Matthias Brugger, Vinod Koul,
	linux-mediatek, Chunfeng Yun, linux-arm-kernel

Il 24/12/21 09:21, Miaoqian Lin ha scritto:
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
> 
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-24  9:55   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 25+ messages in thread
From: AngeloGioacchino Del Regno @ 2021-12-24  9:55 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun,
	Kishon Vijay Abraham I, Vinod Koul, Matthias Brugger, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-phy, linux-kernel

Il 24/12/21 09:21, Miaoqian Lin ha scritto:
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
> 
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-24  9:55   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 25+ messages in thread
From: AngeloGioacchino Del Regno @ 2021-12-24  9:55 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun,
	Kishon Vijay Abraham I, Vinod Koul, Matthias Brugger, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-phy, linux-kernel

Il 24/12/21 09:21, Miaoqian Lin ha scritto:
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
> 
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-24  9:55   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 25+ messages in thread
From: AngeloGioacchino Del Regno @ 2021-12-24  9:55 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun,
	Kishon Vijay Abraham I, Vinod Koul, Matthias Brugger, dri-devel,
	linux-mediatek, linux-arm-kernel, linux-phy, linux-kernel

Il 24/12/21 09:21, Miaoqian Lin ha scritto:
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
> 
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
  2021-12-24  8:21 ` Miaoqian Lin
                     ` (2 preceding siblings ...)
  (?)
@ 2021-12-30  1:56   ` Chunfeng Yun
  -1 siblings, 0 replies; 25+ messages in thread
From: Chunfeng Yun @ 2021-12-30  1:56 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, Philipp Zabel, Kishon Vijay Abraham I, Vinod Koul,
	Matthias Brugger, dri-devel, linux-mediatek, linux-arm-kernel,
	linux-phy, linux-kernel

On Fri, 2021-12-24 at 08:21 +0000, Miaoqian Lin wrote:
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
> 
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> index 28ad9403c441..67b005d5b9e3 100644
> --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct
> platform_device *pdev)
>  		return -ENOMEM;
>  
>  	mipi_tx->driver_data = of_device_get_match_data(dev);
> +	if (!mipi_tx->driver_data)
> +		return -ENODEV;
>  
>  	mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(mipi_tx->regs))

Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

Thanks

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-30  1:56   ` Chunfeng Yun
  0 siblings, 0 replies; 25+ messages in thread
From: Chunfeng Yun @ 2021-12-30  1:56 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, Philipp Zabel, Kishon Vijay Abraham I, Vinod Koul,
	Matthias Brugger, dri-devel, linux-mediatek, linux-arm-kernel,
	linux-phy, linux-kernel

On Fri, 2021-12-24 at 08:21 +0000, Miaoqian Lin wrote:
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
> 
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> index 28ad9403c441..67b005d5b9e3 100644
> --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct
> platform_device *pdev)
>  		return -ENOMEM;
>  
>  	mipi_tx->driver_data = of_device_get_match_data(dev);
> +	if (!mipi_tx->driver_data)
> +		return -ENODEV;
>  
>  	mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(mipi_tx->regs))

Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

Thanks
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-30  1:56   ` Chunfeng Yun
  0 siblings, 0 replies; 25+ messages in thread
From: Chunfeng Yun @ 2021-12-30  1:56 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, Philipp Zabel, Kishon Vijay Abraham I, Vinod Koul,
	Matthias Brugger, dri-devel, linux-mediatek, linux-arm-kernel,
	linux-phy, linux-kernel

On Fri, 2021-12-24 at 08:21 +0000, Miaoqian Lin wrote:
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
> 
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> index 28ad9403c441..67b005d5b9e3 100644
> --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct
> platform_device *pdev)
>  		return -ENOMEM;
>  
>  	mipi_tx->driver_data = of_device_get_match_data(dev);
> +	if (!mipi_tx->driver_data)
> +		return -ENODEV;
>  
>  	mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(mipi_tx->regs))

Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

Thanks
-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-30  1:56   ` Chunfeng Yun
  0 siblings, 0 replies; 25+ messages in thread
From: Chunfeng Yun @ 2021-12-30  1:56 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, Philipp Zabel, Kishon Vijay Abraham I, Vinod Koul,
	Matthias Brugger, dri-devel, linux-mediatek, linux-arm-kernel,
	linux-phy, linux-kernel

On Fri, 2021-12-24 at 08:21 +0000, Miaoqian Lin wrote:
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
> 
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> index 28ad9403c441..67b005d5b9e3 100644
> --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct
> platform_device *pdev)
>  		return -ENOMEM;
>  
>  	mipi_tx->driver_data = of_device_get_match_data(dev);
> +	if (!mipi_tx->driver_data)
> +		return -ENODEV;
>  
>  	mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(mipi_tx->regs))

Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

Thanks
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-30  1:56   ` Chunfeng Yun
  0 siblings, 0 replies; 25+ messages in thread
From: Chunfeng Yun @ 2021-12-30  1:56 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, linux-kernel, dri-devel, Kishon Vijay Abraham I,
	linux-phy, Vinod Koul, linux-mediatek, Matthias Brugger,
	linux-arm-kernel

On Fri, 2021-12-24 at 08:21 +0000, Miaoqian Lin wrote:
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
> 
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> index 28ad9403c441..67b005d5b9e3 100644
> --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct
> platform_device *pdev)
>  		return -ENOMEM;
>  
>  	mipi_tx->driver_data = of_device_get_match_data(dev);
> +	if (!mipi_tx->driver_data)
> +		return -ENODEV;
>  
>  	mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(mipi_tx->regs))

Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

Thanks

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
  2021-12-24  8:21 ` Miaoqian Lin
                     ` (2 preceding siblings ...)
  (?)
@ 2021-12-30 16:31   ` Chun-Kuang Hu
  -1 siblings, 0 replies; 25+ messages in thread
From: Chun-Kuang Hu @ 2021-12-30 16:31 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun,
	Kishon Vijay Abraham I, Vinod Koul, Matthias Brugger,
	DRI Development, moderated list:ARM/Mediatek SoC support,
	Linux ARM, linux-phy, linux-kernel

Hi, Miaoqian:

Miaoqian Lin <linmq006@gmail.com> 於 2021年12月24日 週五 下午4:21寫道:
>
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
>
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> index 28ad9403c441..67b005d5b9e3 100644
> --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
>                 return -ENOMEM;
>
>         mipi_tx->driver_data = of_device_get_match_data(dev);
> +       if (!mipi_tx->driver_data)

I'm confused. mtk_mipi_tx_probe() is called because this device node's
compatible match one in mtk_mipi_tx_match[]. So I think the return
value of of_device_get_match_data(dev) would not be NULL. If this is
true, this checking is redundant.

Regards,
Chun-Kuang.

> +               return -ENODEV;
>
>         mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(mipi_tx->regs))
> --
> 2.17.1
>

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-30 16:31   ` Chun-Kuang Hu
  0 siblings, 0 replies; 25+ messages in thread
From: Chun-Kuang Hu @ 2021-12-30 16:31 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun,
	Kishon Vijay Abraham I, Vinod Koul, Matthias Brugger,
	DRI Development, moderated list:ARM/Mediatek SoC support,
	Linux ARM, linux-phy, linux-kernel

Hi, Miaoqian:

Miaoqian Lin <linmq006@gmail.com> 於 2021年12月24日 週五 下午4:21寫道:
>
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
>
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> index 28ad9403c441..67b005d5b9e3 100644
> --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
>                 return -ENOMEM;
>
>         mipi_tx->driver_data = of_device_get_match_data(dev);
> +       if (!mipi_tx->driver_data)

I'm confused. mtk_mipi_tx_probe() is called because this device node's
compatible match one in mtk_mipi_tx_match[]. So I think the return
value of of_device_get_match_data(dev) would not be NULL. If this is
true, this checking is redundant.

Regards,
Chun-Kuang.

> +               return -ENODEV;
>
>         mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(mipi_tx->regs))
> --
> 2.17.1
>

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-30 16:31   ` Chun-Kuang Hu
  0 siblings, 0 replies; 25+ messages in thread
From: Chun-Kuang Hu @ 2021-12-30 16:31 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, linux-phy, linux-kernel, DRI Development,
	Kishon Vijay Abraham I, Matthias Brugger, Vinod Koul,
	moderated list:ARM/Mediatek SoC support, Chunfeng Yun, Linux ARM

Hi, Miaoqian:

Miaoqian Lin <linmq006@gmail.com> 於 2021年12月24日 週五 下午4:21寫道:
>
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
>
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> index 28ad9403c441..67b005d5b9e3 100644
> --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
>                 return -ENOMEM;
>
>         mipi_tx->driver_data = of_device_get_match_data(dev);
> +       if (!mipi_tx->driver_data)

I'm confused. mtk_mipi_tx_probe() is called because this device node's
compatible match one in mtk_mipi_tx_match[]. So I think the return
value of of_device_get_match_data(dev) would not be NULL. If this is
true, this checking is redundant.

Regards,
Chun-Kuang.

> +               return -ENODEV;
>
>         mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(mipi_tx->regs))
> --
> 2.17.1
>

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-30 16:31   ` Chun-Kuang Hu
  0 siblings, 0 replies; 25+ messages in thread
From: Chun-Kuang Hu @ 2021-12-30 16:31 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun,
	Kishon Vijay Abraham I, Vinod Koul, Matthias Brugger,
	DRI Development, moderated list:ARM/Mediatek SoC support,
	Linux ARM, linux-phy, linux-kernel

Hi, Miaoqian:

Miaoqian Lin <linmq006@gmail.com> 於 2021年12月24日 週五 下午4:21寫道:
>
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
>
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> index 28ad9403c441..67b005d5b9e3 100644
> --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
>                 return -ENOMEM;
>
>         mipi_tx->driver_data = of_device_get_match_data(dev);
> +       if (!mipi_tx->driver_data)

I'm confused. mtk_mipi_tx_probe() is called because this device node's
compatible match one in mtk_mipi_tx_match[]. So I think the return
value of of_device_get_match_data(dev) would not be NULL. If this is
true, this checking is redundant.

Regards,
Chun-Kuang.

> +               return -ENODEV;
>
>         mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(mipi_tx->regs))
> --
> 2.17.1
>

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2021-12-30 16:31   ` Chun-Kuang Hu
  0 siblings, 0 replies; 25+ messages in thread
From: Chun-Kuang Hu @ 2021-12-30 16:31 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun,
	Kishon Vijay Abraham I, Vinod Koul, Matthias Brugger,
	DRI Development, moderated list:ARM/Mediatek SoC support,
	Linux ARM, linux-phy, linux-kernel

Hi, Miaoqian:

Miaoqian Lin <linmq006@gmail.com> 於 2021年12月24日 週五 下午4:21寫道:
>
> The of_device_get_match_data() function may return NULL.
> Add check to prevent potential null dereference.
>
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> index 28ad9403c441..67b005d5b9e3 100644
> --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
>                 return -ENOMEM;
>
>         mipi_tx->driver_data = of_device_get_match_data(dev);
> +       if (!mipi_tx->driver_data)

I'm confused. mtk_mipi_tx_probe() is called because this device node's
compatible match one in mtk_mipi_tx_match[]. So I think the return
value of of_device_get_match_data(dev) would not be NULL. If this is
true, this checking is redundant.

Regards,
Chun-Kuang.

> +               return -ENODEV;
>
>         mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(mipi_tx->regs))
> --
> 2.17.1
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
  2021-12-30 16:31   ` Chun-Kuang Hu
                       ` (2 preceding siblings ...)
  (?)
@ 2022-01-06 12:16     ` Miaoqian Lin
  -1 siblings, 0 replies; 25+ messages in thread
From: Miaoqian Lin @ 2022-01-06 12:16 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Philipp Zabel, Chunfeng Yun, Kishon Vijay Abraham I, Vinod Koul,
	Matthias Brugger, DRI Development,
	moderated list:ARM/Mediatek SoC support, Linux ARM, linux-phy,
	linux-kernel

Hi, Chun-Kuang:

On Fri, Dec 31, 2021 at 12:31:33AM +0800, Chun-Kuang Hu wrote:
> > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > index 28ad9403c441..67b005d5b9e3 100644
> > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
> >                 return -ENOMEM;
> >
> >         mipi_tx->driver_data = of_device_get_match_data(dev);
> > +       if (!mipi_tx->driver_data)
> 
> I'm confused. mtk_mipi_tx_probe() is called because this device node's
> compatible match one in mtk_mipi_tx_match[]. So I think the return
> value of of_device_get_match_data(dev) would not be NULL. If this is
> true, this checking is redundant.
>
I think your are right, this checking is redundant. Thanks for your
reply.

Regards,
Miaoqian.

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2022-01-06 12:16     ` Miaoqian Lin
  0 siblings, 0 replies; 25+ messages in thread
From: Miaoqian Lin @ 2022-01-06 12:16 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Philipp Zabel, Chunfeng Yun, Kishon Vijay Abraham I, Vinod Koul,
	Matthias Brugger, DRI Development,
	moderated list:ARM/Mediatek SoC support, Linux ARM, linux-phy,
	linux-kernel

Hi, Chun-Kuang:

On Fri, Dec 31, 2021 at 12:31:33AM +0800, Chun-Kuang Hu wrote:
> > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > index 28ad9403c441..67b005d5b9e3 100644
> > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
> >                 return -ENOMEM;
> >
> >         mipi_tx->driver_data = of_device_get_match_data(dev);
> > +       if (!mipi_tx->driver_data)
> 
> I'm confused. mtk_mipi_tx_probe() is called because this device node's
> compatible match one in mtk_mipi_tx_match[]. So I think the return
> value of of_device_get_match_data(dev) would not be NULL. If this is
> true, this checking is redundant.
>
I think your are right, this checking is redundant. Thanks for your
reply.

Regards,
Miaoqian.

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2022-01-06 12:16     ` Miaoqian Lin
  0 siblings, 0 replies; 25+ messages in thread
From: Miaoqian Lin @ 2022-01-06 12:16 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: linux-phy, linux-kernel, DRI Development, Kishon Vijay Abraham I,
	Matthias Brugger, Vinod Koul,
	moderated list:ARM/Mediatek SoC support, Chunfeng Yun, Linux ARM

Hi, Chun-Kuang:

On Fri, Dec 31, 2021 at 12:31:33AM +0800, Chun-Kuang Hu wrote:
> > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > index 28ad9403c441..67b005d5b9e3 100644
> > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
> >                 return -ENOMEM;
> >
> >         mipi_tx->driver_data = of_device_get_match_data(dev);
> > +       if (!mipi_tx->driver_data)
> 
> I'm confused. mtk_mipi_tx_probe() is called because this device node's
> compatible match one in mtk_mipi_tx_match[]. So I think the return
> value of of_device_get_match_data(dev) would not be NULL. If this is
> true, this checking is redundant.
>
I think your are right, this checking is redundant. Thanks for your
reply.

Regards,
Miaoqian.

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2022-01-06 12:16     ` Miaoqian Lin
  0 siblings, 0 replies; 25+ messages in thread
From: Miaoqian Lin @ 2022-01-06 12:16 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Philipp Zabel, Chunfeng Yun, Kishon Vijay Abraham I, Vinod Koul,
	Matthias Brugger, DRI Development,
	moderated list:ARM/Mediatek SoC support, Linux ARM, linux-phy,
	linux-kernel

Hi, Chun-Kuang:

On Fri, Dec 31, 2021 at 12:31:33AM +0800, Chun-Kuang Hu wrote:
> > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > index 28ad9403c441..67b005d5b9e3 100644
> > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
> >                 return -ENOMEM;
> >
> >         mipi_tx->driver_data = of_device_get_match_data(dev);
> > +       if (!mipi_tx->driver_data)
> 
> I'm confused. mtk_mipi_tx_probe() is called because this device node's
> compatible match one in mtk_mipi_tx_match[]. So I think the return
> value of of_device_get_match_data(dev) would not be NULL. If this is
> true, this checking is redundant.
>
I think your are right, this checking is redundant. Thanks for your
reply.

Regards,
Miaoqian.

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe
@ 2022-01-06 12:16     ` Miaoqian Lin
  0 siblings, 0 replies; 25+ messages in thread
From: Miaoqian Lin @ 2022-01-06 12:16 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Philipp Zabel, Chunfeng Yun, Kishon Vijay Abraham I, Vinod Koul,
	Matthias Brugger, DRI Development,
	moderated list:ARM/Mediatek SoC support, Linux ARM, linux-phy,
	linux-kernel

Hi, Chun-Kuang:

On Fri, Dec 31, 2021 at 12:31:33AM +0800, Chun-Kuang Hu wrote:
> > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > index 28ad9403c441..67b005d5b9e3 100644
> > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> > @@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
> >                 return -ENOMEM;
> >
> >         mipi_tx->driver_data = of_device_get_match_data(dev);
> > +       if (!mipi_tx->driver_data)
> 
> I'm confused. mtk_mipi_tx_probe() is called because this device node's
> compatible match one in mtk_mipi_tx_match[]. So I think the return
> value of of_device_get_match_data(dev) would not be NULL. If this is
> true, this checking is redundant.
>
I think your are right, this checking is redundant. Thanks for your
reply.

Regards,
Miaoqian.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-01-06 12:17 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-24  8:21 [PATCH] phy: mediatek: Fix missing check in mtk_mipi_tx_probe Miaoqian Lin
2021-12-24  8:21 ` Miaoqian Lin
2021-12-24  8:21 ` Miaoqian Lin
2021-12-24  8:21 ` Miaoqian Lin
2021-12-24  8:21 ` Miaoqian Lin
2021-12-24  9:55 ` AngeloGioacchino Del Regno
2021-12-24  9:55   ` AngeloGioacchino Del Regno
2021-12-24  9:55   ` AngeloGioacchino Del Regno
2021-12-24  9:55   ` AngeloGioacchino Del Regno
2021-12-24  9:55   ` AngeloGioacchino Del Regno
2021-12-30  1:56 ` Chunfeng Yun
2021-12-30  1:56   ` Chunfeng Yun
2021-12-30  1:56   ` Chunfeng Yun
2021-12-30  1:56   ` Chunfeng Yun
2021-12-30  1:56   ` Chunfeng Yun
2021-12-30 16:31 ` Chun-Kuang Hu
2021-12-30 16:31   ` Chun-Kuang Hu
2021-12-30 16:31   ` Chun-Kuang Hu
2021-12-30 16:31   ` Chun-Kuang Hu
2021-12-30 16:31   ` Chun-Kuang Hu
2022-01-06 12:16   ` Miaoqian Lin
2022-01-06 12:16     ` Miaoqian Lin
2022-01-06 12:16     ` Miaoqian Lin
2022-01-06 12:16     ` Miaoqian Lin
2022-01-06 12:16     ` Miaoqian Lin

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.