linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dma: ste_dma40: Remove duplicate const
@ 2013-09-02  8:14 Sachin Kamat
  2013-09-02  8:14 ` [PATCH 2/2] dma: ste_dma40: Fix potential null pointer dereference Sachin Kamat
  2013-09-02 10:46 ` [PATCH 1/2] dma: ste_dma40: Remove duplicate const Vinod Koul
  0 siblings, 2 replies; 4+ messages in thread
From: Sachin Kamat @ 2013-09-02  8:14 UTC (permalink / raw)
  To: linux-arm-kernel

'const' was added twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/dma/ste_dma40.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 7bbcabb..df0a606 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3485,7 +3485,7 @@ static int __init d40_of_probe(struct platform_device *pdev,
 {
 	struct stedma40_platform_data *pdata;
 	int num_phy = 0, num_memcpy = 0, num_disabled = 0;
-	const const __be32 *list;
+	const __be32 *list;
 
 	pdata = devm_kzalloc(&pdev->dev,
 			     sizeof(struct stedma40_platform_data),
-- 
1.7.9.5

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

* [PATCH 2/2] dma: ste_dma40: Fix potential null pointer dereference
  2013-09-02  8:14 [PATCH 1/2] dma: ste_dma40: Remove duplicate const Sachin Kamat
@ 2013-09-02  8:14 ` Sachin Kamat
  2013-09-12  9:34   ` Linus Walleij
  2013-09-02 10:46 ` [PATCH 1/2] dma: ste_dma40: Remove duplicate const Vinod Koul
  1 sibling, 1 reply; 4+ messages in thread
From: Sachin Kamat @ 2013-09-02  8:14 UTC (permalink / raw)
  To: linux-arm-kernel

kcalloc can return NULL. Check the pointer before dereferencing.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/dma/ste_dma40.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index df0a606..82d2b97 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2591,6 +2591,9 @@ dma40_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr,
 	int i;
 
 	sg = kcalloc(periods + 1, sizeof(struct scatterlist), GFP_NOWAIT);
+	if (!sg)
+		return NULL;
+
 	for (i = 0; i < periods; i++) {
 		sg_dma_address(&sg[i]) = dma_addr;
 		sg_dma_len(&sg[i]) = period_len;
-- 
1.7.9.5

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

* [PATCH 1/2] dma: ste_dma40: Remove duplicate const
  2013-09-02  8:14 [PATCH 1/2] dma: ste_dma40: Remove duplicate const Sachin Kamat
  2013-09-02  8:14 ` [PATCH 2/2] dma: ste_dma40: Fix potential null pointer dereference Sachin Kamat
@ 2013-09-02 10:46 ` Vinod Koul
  1 sibling, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2013-09-02 10:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Sep 02, 2013 at 01:44:58PM +0530, Sachin Kamat wrote:
> 'const' was added twice.
> 
Applied, both thanks

~Vinod

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

* [PATCH 2/2] dma: ste_dma40: Fix potential null pointer dereference
  2013-09-02  8:14 ` [PATCH 2/2] dma: ste_dma40: Fix potential null pointer dereference Sachin Kamat
@ 2013-09-12  9:34   ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2013-09-12  9:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Sep 2, 2013 at 10:14 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:

> kcalloc can return NULL. Check the pointer before dereferencing.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

I guess Vinod can take this into fixes for v3.12?

Yours,
Linus Walleij

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

end of thread, other threads:[~2013-09-12  9:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-02  8:14 [PATCH 1/2] dma: ste_dma40: Remove duplicate const Sachin Kamat
2013-09-02  8:14 ` [PATCH 2/2] dma: ste_dma40: Fix potential null pointer dereference Sachin Kamat
2013-09-12  9:34   ` Linus Walleij
2013-09-02 10:46 ` [PATCH 1/2] dma: ste_dma40: Remove duplicate const Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).