Skip to contentSkip to conversation

of: dma.c: fix memory leakage

PATCH Superseded Cong Ding 3 participants 8 messages Jan 19, 2013 – Feb 14, 2013

Subsystems (2)
lore
Share & tools
lore

Cong Ding

author
#0 lore raw

PATCH 1/1 of: dma.c: fix memory leakage

The memory allocated to ofdma might be a leakage when error occurs.

---
 drivers/of/dma.c |    1 +
 1 file changed, 1 insertion(+)
drivers/of/dma.c +1 -0
index 59631b2..583e50e3 100644
@@ -107,6 +107,7 @@ int of_dma_controller_register(struct device_node *np,
 	if (!nbcells) {
 		pr_err("%s: #dma-cells property is missing or invalid\n",
 		       __func__);
+		kfree(ofdma);
 		return -EINVAL;
 	}
 
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 3 lines · Cong Ding

The memory allocated to ofdma might be a leakage when error occurs.

You need to send this to whomever is working on DMA bindings.

Rob

Quoted 17 lines
---
 drivers/of/dma.c |    1 +
 1 file changed, 1 insertion(+)
drivers/of/dma.c +1 -0
index 59631b2..583e50e3 100644
@@ -107,6 +107,7 @@ int of_dma_controller_register(struct device_node *np,
 	if (!nbcells) {
 		pr_err("%s: #dma-cells property is missing or invalid\n",
 		       __func__);
+		kfree(ofdma);
 		return -EINVAL;
 	}
 
author
#2 lore raw
Quoted 6 lines · Rob Herring
Quoted 3 lines · Cong Ding

The memory allocated to ofdma might be a leakage when error occurs.

You need to send this to whomever is working on DMA bindings.

Thank you bob, I added Vinod the the receiver list.

- cong

Quoted 18 lines
Quoted 18 lines
---
 drivers/of/dma.c |    1 +
 1 file changed, 1 insertion(+)
drivers/of/dma.c +1 -0
index 59631b2..583e50e3 100644
@@ -107,6 +107,7 @@ int of_dma_controller_register(struct device_node *np,
 	if (!nbcells) {
 		pr_err("%s: #dma-cells property is missing or invalid\n",
 		       __func__);
+		kfree(ofdma);
 		return -EINVAL;
 	}
 
#3 lore raw
Quoted 8 lines · Cong Ding
Quoted 6 lines · Rob Herring
Quoted 3 lines · Cong Ding

The memory allocated to ofdma might be a leakage when error occurs.

You need to send this to whomever is working on DMA bindings.

Thank you bob, I added Vinod the the receiver list.

I have moved the of/dma.c to dma/of-dma.c, can you regenerate this patch and resend to me

--
~Vinod

author
#4 lore raw
Quoted 11 lines · Vinod Koul
Quoted 8 lines · Cong Ding
Quoted 6 lines · Rob Herring
Quoted 3 lines · Cong Ding

The memory allocated to ofdma might be a leakage when error occurs.

You need to send this to whomever is working on DMA bindings.

Thank you bob, I added Vinod the the receiver list.

I have moved the of/dma.c to dma/of-dma.c, can you regenerate this patch and resend to me

Sorry Vinod, I didn't manage to get this commit from either linux-next tree or slave-dma tree, and the last commit by you for of/dma.c file is on Jan 7. Did you have any hints for me to get the latest version dma/of-dma.c?
- cong

#5 lore raw
Quoted 7 lines · Cong Ding
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

You need to send this to whomever is working on DMA bindings.

Thank you bob, I added Vinod the the receiver list.

I have moved the of/dma.c to dma/of-dma.c, can you regenerate this patch and resend to me

Sorry Vinod, I didn't manage to get this commit from either linux-next tree or slave-dma tree, and the last commit by you for of/dma.c file is on Jan 7. Did you have any hints for me to get the latest version dma/of-dma.c?

AH my bad, seems i have not pushed it out :(

Pushed now...

author
#6 lore raw

PATCH v2 1/1 dma: of-dma.c: fix memory leakage

In reply to Vinod Koul

The memory allocated to ofdma might be a leakage when error occurs.

---
 drivers/dma/of-dma.c |    1 +
 1 file changed, 1 insertion(+)
drivers/dma/of-dma.c +1 -0
index 59631b2..583e50e3 100644
@@ -107,6 +107,7 @@ int of_dma_controller_register(struct device_node *np,
 	if (!nbcells) {
 		pr_err("%s: #dma-cells property is missing or invalid\n",
 		       __func__);
+		kfree(ofdma);
 		return -EINVAL;
 	}
 
Signature · 1 line
1.7.9.5
Applied
#7 lore raw

Re: [PATCH v2] dma: of-dma.c: fix memory leakage

Quoted 3 lines · Cong Ding

The memory allocated to ofdma might be a leakage when error occurs.

Applied, thanks

--
~Vinod

Quoted 19 lines
---
 drivers/dma/of-dma.c |    1 +
 1 file changed, 1 insertion(+)
drivers/dma/of-dma.c +1 -0
index 59631b2..583e50e3 100644
@@ -107,6 +107,7 @@ int of_dma_controller_register(struct device_node *np,
 	if (!nbcells) {
 		pr_err("%s: #dma-cells property is missing or invalid\n",
 		       __func__);
+		kfree(ofdma);
 		return -EINVAL;
 	}
 
Signature · 1 line
1.7.9.5