All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Dma - Fix possible NULL derefrence.
       [not found] <CGME20170127112626epcas3p137caa1e5fdbf0bb07ae5f057bf819828@epcas3p1.samsung.com>
@ 2017-01-27 11:25 ` Shailendra Verma
  2017-01-30 16:49   ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Shailendra Verma @ 2017-01-27 11:25 UTC (permalink / raw)
  To: Dan Williams, Vinod Koul, dmaengine, linux-kernel, p.shailesh,
	ashish.kalra, Shailendra Verma, Shailendra Verma

of_match_device could return NULL, and so cause a NULL
pointer dereference later.

Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
---
 drivers/dma/mv_xor.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 23f7528..c25b3bb 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1323,7 +1323,10 @@ static int mv_xor_probe(struct platform_device *pdev)
 		const struct of_device_id *of_id =
 			of_match_device(mv_xor_dt_ids,
 					&pdev->dev);
+		if (!of_id) {
+			dev_err(&pdev->dev, "Error: No device match found\n");
+			return -ENODEV;
+		}
 		xordev->xor_type = (uintptr_t)of_id->data;
 	}
 
-- 
1.7.9.5

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

* Re: [PATCH] Dma - Fix possible NULL derefrence.
  2017-01-27 11:25 ` [PATCH] Dma - Fix possible NULL derefrence Shailendra Verma
@ 2017-01-30 16:49   ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2017-01-30 16:49 UTC (permalink / raw)
  To: Shailendra Verma
  Cc: Dan Williams, dmaengine, linux-kernel, p.shailesh, ashish.kalra,
	Shailendra Verma

On Fri, Jan 27, 2017 at 04:55:59PM +0530, Shailendra Verma wrote:
> of_match_device could return NULL, and so cause a NULL
> pointer dereference later.

Why is this tagged Dma - ....

Please look at he git log for the file before coming up with random tags

Worst part, this patch fails to apply, so which was this generated against?

> 
> Signed-off-by: Shailendra Verma <shailendra.v@samsung.com>
> ---
>  drivers/dma/mv_xor.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
> index 23f7528..c25b3bb 100644
> --- a/drivers/dma/mv_xor.c
> +++ b/drivers/dma/mv_xor.c
> @@ -1323,7 +1323,10 @@ static int mv_xor_probe(struct platform_device *pdev)
>  		const struct of_device_id *of_id =
>  			of_match_device(mv_xor_dt_ids,
>  					&pdev->dev);
> +		if (!of_id) {
> +			dev_err(&pdev->dev, "Error: No device match found\n");
> +			return -ENODEV;
> +		}
>  		xordev->xor_type = (uintptr_t)of_id->data;
>  	}
>  
> -- 
> 1.7.9.5
> 

-- 
~Vinod

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

end of thread, other threads:[~2017-01-30 16:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170127112626epcas3p137caa1e5fdbf0bb07ae5f057bf819828@epcas3p1.samsung.com>
2017-01-27 11:25 ` [PATCH] Dma - Fix possible NULL derefrence Shailendra Verma
2017-01-30 16:49   ` Vinod Koul

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.