All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] drivers: mmc: Avoid memory leak in case of failure
@ 2017-06-19 16:53 ` sunil.m at techveda.org
  2017-07-17 11:08   ` Jaehoon Chung
  0 siblings, 1 reply; 7+ messages in thread
From: sunil.m at techveda.org @ 2017-06-19 16:53 UTC (permalink / raw)
  To: u-boot

From: Suniel Mahesh <sunil.m@techveda.org>

priv pointer should be freed before returning with an error value
from exynos_dwmci_get_config().

Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Signed-off-by: Raghu Bharadwaj <raghu@techveda.org>
---
 drivers/mmc/exynos_dw_mmc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
index 40f7892..84ef2da 100644
--- a/drivers/mmc/exynos_dw_mmc.c
+++ b/drivers/mmc/exynos_dw_mmc.c
@@ -168,6 +168,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
 
 	if (host->dev_index > 4) {
 		printf("DWMMC%d: Can't get the dev index\n", host->dev_index);
+		free(priv);
 		return -EINVAL;
 	}
 
@@ -178,6 +179,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
 	base = fdtdec_get_addr(blob, node, "reg");
 	if (!base) {
 		printf("DWMMC%d: Can't get base address\n", host->dev_index);
+		free(priv);
 		return -EINVAL;
 	}
 	host->ioaddr = (void *)base;
@@ -187,6 +189,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
 	if (err) {
 		printf("DWMMC%d: Can't get sdr-timings for devider\n",
 				host->dev_index);
+		free(priv);
 		return -EINVAL;
 	}
 
-- 
1.9.1

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

* [U-Boot] [PATCH] drivers: mmc: Avoid memory leak in case of failure
  2017-06-19 16:53 ` [U-Boot] [PATCH] drivers: mmc: Avoid memory leak in case of failure sunil.m at techveda.org
@ 2017-07-17 11:08   ` Jaehoon Chung
  2017-08-04  9:34     ` Suniel Mahesh
  0 siblings, 1 reply; 7+ messages in thread
From: Jaehoon Chung @ 2017-07-17 11:08 UTC (permalink / raw)
  To: u-boot

On 06/20/2017 01:53 AM, sunil.m at techveda.org wrote:
> From: Suniel Mahesh <sunil.m@techveda.org>
> 
> priv pointer should be freed before returning with an error value
> from exynos_dwmci_get_config().
> 
> Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
> Signed-off-by: Raghu Bharadwaj <raghu@techveda.org>

Applied to u-boot-mmc.

Best Regards,
Jaehoon Chung
> ---
>  drivers/mmc/exynos_dw_mmc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
> index 40f7892..84ef2da 100644
> --- a/drivers/mmc/exynos_dw_mmc.c
> +++ b/drivers/mmc/exynos_dw_mmc.c
> @@ -168,6 +168,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>  
>  	if (host->dev_index > 4) {
>  		printf("DWMMC%d: Can't get the dev index\n", host->dev_index);
> +		free(priv);
>  		return -EINVAL;
>  	}
>  
> @@ -178,6 +179,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>  	base = fdtdec_get_addr(blob, node, "reg");
>  	if (!base) {
>  		printf("DWMMC%d: Can't get base address\n", host->dev_index);
> +		free(priv);
>  		return -EINVAL;
>  	}
>  	host->ioaddr = (void *)base;
> @@ -187,6 +189,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>  	if (err) {
>  		printf("DWMMC%d: Can't get sdr-timings for devider\n",
>  				host->dev_index);
> +		free(priv);
>  		return -EINVAL;
>  	}
>  
> 

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

* [U-Boot] [PATCH] drivers: mmc: Avoid memory leak in case of failure
  2017-07-17 11:08   ` Jaehoon Chung
@ 2017-08-04  9:34     ` Suniel Mahesh
  2017-08-18  7:30       ` Jaehoon Chung
  0 siblings, 1 reply; 7+ messages in thread
From: Suniel Mahesh @ 2017-08-04  9:34 UTC (permalink / raw)
  To: u-boot

On Monday 17 July 2017 04:38 PM, Jaehoon Chung wrote:
> On 06/20/2017 01:53 AM, sunil.m at techveda.org wrote:
>> From: Suniel Mahesh <sunil.m@techveda.org>
>>
>> priv pointer should be freed before returning with an error value
>> from exynos_dwmci_get_config().
>>
>> Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
>> Signed-off-by: Raghu Bharadwaj <raghu@techveda.org>
> 
> Applied to u-boot-mmc.

Hi, It says the patch has been applied to u-boot-mmc git tree,
but I couldn't find it there applied.
http://git.denx.de/?p=u-boot/u-boot-mmc.git;a=summary

are there any issues with the patch or am I looking at the wrong place ? 

Thanks
suniel

> 
> Best Regards,
> Jaehoon Chung
>> ---
>>  drivers/mmc/exynos_dw_mmc.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
>> index 40f7892..84ef2da 100644
>> --- a/drivers/mmc/exynos_dw_mmc.c
>> +++ b/drivers/mmc/exynos_dw_mmc.c
>> @@ -168,6 +168,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>>  
>>  	if (host->dev_index > 4) {
>>  		printf("DWMMC%d: Can't get the dev index\n", host->dev_index);
>> +		free(priv);
>>  		return -EINVAL;
>>  	}
>>  
>> @@ -178,6 +179,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>>  	base = fdtdec_get_addr(blob, node, "reg");
>>  	if (!base) {
>>  		printf("DWMMC%d: Can't get base address\n", host->dev_index);
>> +		free(priv);
>>  		return -EINVAL;
>>  	}
>>  	host->ioaddr = (void *)base;
>> @@ -187,6 +189,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>>  	if (err) {
>>  		printf("DWMMC%d: Can't get sdr-timings for devider\n",
>>  				host->dev_index);
>> +		free(priv);
>>  		return -EINVAL;
>>  	}
>>  
>>
> 

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

* [U-Boot] [PATCH] drivers: mmc: Avoid memory leak in case of failure
  2017-08-04  9:34     ` Suniel Mahesh
@ 2017-08-18  7:30       ` Jaehoon Chung
  2017-09-25 10:47         ` Suniel Mahesh
  2017-10-05  6:18         ` [U-Boot] [PATCH v2] " sunil.m at techveda.org
  0 siblings, 2 replies; 7+ messages in thread
From: Jaehoon Chung @ 2017-08-18  7:30 UTC (permalink / raw)
  To: u-boot

On 08/04/2017 06:34 PM, Suniel Mahesh wrote:
> On Monday 17 July 2017 04:38 PM, Jaehoon Chung wrote:
>> On 06/20/2017 01:53 AM, sunil.m at techveda.org wrote:
>>> From: Suniel Mahesh <sunil.m@techveda.org>
>>>
>>> priv pointer should be freed before returning with an error value
>>> from exynos_dwmci_get_config().
>>>
>>> Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
>>> Signed-off-by: Raghu Bharadwaj <raghu@techveda.org>
>>
>> Applied to u-boot-mmc.
> 
> Hi, It says the patch has been applied to u-boot-mmc git tree,
> but I couldn't find it there applied.
> http://git.denx.de/?p=u-boot/u-boot-mmc.git;a=summary
> 
> are there any issues with the patch or am I looking at the wrong place ? 

Right place..Sorry..i missed it..when i rebased..will re-apply.
Thanks for pointing out.

Best Regards,
Jaehoon Chung

> 
> Thanks
> suniel
> 
>>
>> Best Regards,
>> Jaehoon Chung
>>> ---
>>>  drivers/mmc/exynos_dw_mmc.c | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
>>> index 40f7892..84ef2da 100644
>>> --- a/drivers/mmc/exynos_dw_mmc.c
>>> +++ b/drivers/mmc/exynos_dw_mmc.c
>>> @@ -168,6 +168,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>>>  
>>>  	if (host->dev_index > 4) {
>>>  		printf("DWMMC%d: Can't get the dev index\n", host->dev_index);
>>> +		free(priv);
>>>  		return -EINVAL;
>>>  	}
>>>  
>>> @@ -178,6 +179,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>>>  	base = fdtdec_get_addr(blob, node, "reg");
>>>  	if (!base) {
>>>  		printf("DWMMC%d: Can't get base address\n", host->dev_index);
>>> +		free(priv);
>>>  		return -EINVAL;
>>>  	}
>>>  	host->ioaddr = (void *)base;
>>> @@ -187,6 +189,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>>>  	if (err) {
>>>  		printf("DWMMC%d: Can't get sdr-timings for devider\n",
>>>  				host->dev_index);
>>> +		free(priv);
>>>  		return -EINVAL;
>>>  	}
>>>  
>>>
>>
> 
> 
> 
> 

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

* [U-Boot] [PATCH] drivers: mmc: Avoid memory leak in case of failure
  2017-08-18  7:30       ` Jaehoon Chung
@ 2017-09-25 10:47         ` Suniel Mahesh
  2017-10-05  6:18         ` [U-Boot] [PATCH v2] " sunil.m at techveda.org
  1 sibling, 0 replies; 7+ messages in thread
From: Suniel Mahesh @ 2017-09-25 10:47 UTC (permalink / raw)
  To: u-boot

On Friday 18 August 2017 01:00 PM, Jaehoon Chung wrote:
> On 08/04/2017 06:34 PM, Suniel Mahesh wrote:
>> On Monday 17 July 2017 04:38 PM, Jaehoon Chung wrote:
>>> On 06/20/2017 01:53 AM, sunil.m at techveda.org wrote:
>>>> From: Suniel Mahesh <sunil.m@techveda.org>
>>>>
>>>> priv pointer should be freed before returning with an error value
>>>> from exynos_dwmci_get_config().
>>>>
>>>> Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
>>>> Signed-off-by: Raghu Bharadwaj <raghu@techveda.org>
>>>
>>> Applied to u-boot-mmc.
>>
>> Hi, It says the patch has been applied to u-boot-mmc git tree,
>> but I couldn't find it there applied.
>> http://git.denx.de/?p=u-boot/u-boot-mmc.git;a=summary
>>
>> are there any issues with the patch or am I looking at the wrong place ? 
> 
> Right place..Sorry..i missed it..when i rebased..will re-apply.
> Thanks for pointing out.

Hi,
Just a reminder, please re-apply.

I am rebasing the patch w.r.t latest u-boot source tree and will shortly
send it.

Thanks
suniel
> 
> Best Regards,
> Jaehoon Chung
> 
>>
>> Thanks
>> suniel
>>
>>>
>>> Best Regards,
>>> Jaehoon Chung
>>>> ---
>>>>  drivers/mmc/exynos_dw_mmc.c | 3 +++
>>>>  1 file changed, 3 insertions(+)
>>>>
>>>> diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
>>>> index 40f7892..84ef2da 100644
>>>> --- a/drivers/mmc/exynos_dw_mmc.c
>>>> +++ b/drivers/mmc/exynos_dw_mmc.c
>>>> @@ -168,6 +168,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>>>>  
>>>>  	if (host->dev_index > 4) {
>>>>  		printf("DWMMC%d: Can't get the dev index\n", host->dev_index);
>>>> +		free(priv);
>>>>  		return -EINVAL;
>>>>  	}
>>>>  
>>>> @@ -178,6 +179,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>>>>  	base = fdtdec_get_addr(blob, node, "reg");
>>>>  	if (!base) {
>>>>  		printf("DWMMC%d: Can't get base address\n", host->dev_index);
>>>> +		free(priv);
>>>>  		return -EINVAL;
>>>>  	}
>>>>  	host->ioaddr = (void *)base;
>>>> @@ -187,6 +189,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>>>>  	if (err) {
>>>>  		printf("DWMMC%d: Can't get sdr-timings for devider\n",
>>>>  				host->dev_index);
>>>> +		free(priv);
>>>>  		return -EINVAL;
>>>>  	}
>>>>  
>>>>
>>>
>>
>>
>>
>>
> 

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

* [U-Boot] [PATCH v2] drivers: mmc: Avoid memory leak in case of failure
  2017-08-18  7:30       ` Jaehoon Chung
  2017-09-25 10:47         ` Suniel Mahesh
@ 2017-10-05  6:18         ` sunil.m at techveda.org
  2017-10-20 11:45           ` Jaehoon Chung
  1 sibling, 1 reply; 7+ messages in thread
From: sunil.m at techveda.org @ 2017-10-05  6:18 UTC (permalink / raw)
  To: u-boot

From: Suniel Mahesh <sunil.m@techveda.org>

priv pointer should be freed before returning with an error value
from exynos_dwmci_get_config().

Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Signed-off-by: Raghu Bharadwaj <raghu@techveda.org>
---
Changes for v2:
- rebased on latest u-boot tree (2017.11.rc1)
- patch was accepted long time ago, but not applied to u-boot-mmc,
  please apply.
---
Note:
Tested on latest u-boot mainline tree, no build issues.
---
 drivers/mmc/exynos_dw_mmc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
index 40f7892..84ef2da 100644
--- a/drivers/mmc/exynos_dw_mmc.c
+++ b/drivers/mmc/exynos_dw_mmc.c
@@ -168,6 +168,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
 
 	if (host->dev_index > 4) {
 		printf("DWMMC%d: Can't get the dev index\n", host->dev_index);
+		free(priv);
 		return -EINVAL;
 	}
 
@@ -178,6 +179,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
 	base = fdtdec_get_addr(blob, node, "reg");
 	if (!base) {
 		printf("DWMMC%d: Can't get base address\n", host->dev_index);
+		free(priv);
 		return -EINVAL;
 	}
 	host->ioaddr = (void *)base;
@@ -187,6 +189,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
 	if (err) {
 		printf("DWMMC%d: Can't get sdr-timings for devider\n",
 				host->dev_index);
+		free(priv);
 		return -EINVAL;
 	}
 
-- 
1.9.1

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

* [U-Boot] [PATCH v2] drivers: mmc: Avoid memory leak in case of failure
  2017-10-05  6:18         ` [U-Boot] [PATCH v2] " sunil.m at techveda.org
@ 2017-10-20 11:45           ` Jaehoon Chung
  0 siblings, 0 replies; 7+ messages in thread
From: Jaehoon Chung @ 2017-10-20 11:45 UTC (permalink / raw)
  To: u-boot

On 10/05/2017 03:18 PM, sunil.m at techveda.org wrote:
> From: Suniel Mahesh <sunil.m@techveda.org>
> 
> priv pointer should be freed before returning with an error value
> from exynos_dwmci_get_config().
> 
> Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
> Signed-off-by: Raghu Bharadwaj <raghu@techveda.org>

Applied to u-boot-mmc.

Best Regards,
Jaehoon Chung

> ---
> Changes for v2:
> - rebased on latest u-boot tree (2017.11.rc1)
> - patch was accepted long time ago, but not applied to u-boot-mmc,
>   please apply.
> ---
> Note:
> Tested on latest u-boot mainline tree, no build issues.
> ---
>  drivers/mmc/exynos_dw_mmc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
> index 40f7892..84ef2da 100644
> --- a/drivers/mmc/exynos_dw_mmc.c
> +++ b/drivers/mmc/exynos_dw_mmc.c
> @@ -168,6 +168,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>  
>  	if (host->dev_index > 4) {
>  		printf("DWMMC%d: Can't get the dev index\n", host->dev_index);
> +		free(priv);
>  		return -EINVAL;
>  	}
>  
> @@ -178,6 +179,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>  	base = fdtdec_get_addr(blob, node, "reg");
>  	if (!base) {
>  		printf("DWMMC%d: Can't get base address\n", host->dev_index);
> +		free(priv);
>  		return -EINVAL;
>  	}
>  	host->ioaddr = (void *)base;
> @@ -187,6 +189,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
>  	if (err) {
>  		printf("DWMMC%d: Can't get sdr-timings for devider\n",
>  				host->dev_index);
> +		free(priv);
>  		return -EINVAL;
>  	}
>  
> 

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

end of thread, other threads:[~2017-10-20 11:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170619165424epcas5p1a9f4deac326295f32d2d3e36861bfbbc@epcas5p1.samsung.com>
2017-06-19 16:53 ` [U-Boot] [PATCH] drivers: mmc: Avoid memory leak in case of failure sunil.m at techveda.org
2017-07-17 11:08   ` Jaehoon Chung
2017-08-04  9:34     ` Suniel Mahesh
2017-08-18  7:30       ` Jaehoon Chung
2017-09-25 10:47         ` Suniel Mahesh
2017-10-05  6:18         ` [U-Boot] [PATCH v2] " sunil.m at techveda.org
2017-10-20 11:45           ` Jaehoon Chung

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.