linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: Use devm_* APIs for mc13xxx: remove leftover kfree
@ 2012-09-17 16:17 Andreas Pretzsch
  2012-09-18  0:58 ` Axel Lin
  2012-09-19 11:28 ` Samuel Ortiz
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Pretzsch @ 2012-09-17 16:17 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: Axel Lin, linux-kernel

commit e7c706b1e5ccf28eaaf76c7a4613e80b0ca52863 migrated the allocation
of struct mc13xxx to devm_* functions, but left a kfree(mc13xxx) in the
mc13xxx_common_init error path. Remove it to prevent memory corruption.

Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
---
 drivers/mfd/mc13xxx-core.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index 1ec79b5..1aba023 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -676,7 +676,6 @@ int mc13xxx_common_init(struct mc13xxx *mc13xxx,
 err_mask:
 err_revision:
 		mc13xxx_unlock(mc13xxx);
-		kfree(mc13xxx);
 		return ret;
 	}
 
-- 
1.7.10.4


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

* Re: [PATCH] mfd: Use devm_* APIs for mc13xxx: remove leftover kfree
  2012-09-17 16:17 [PATCH] mfd: Use devm_* APIs for mc13xxx: remove leftover kfree Andreas Pretzsch
@ 2012-09-18  0:58 ` Axel Lin
  2012-09-19 11:28 ` Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Axel Lin @ 2012-09-18  0:58 UTC (permalink / raw)
  To: Andreas Pretzsch; +Cc: Samuel Ortiz, linux-kernel

2012/9/18 Andreas Pretzsch <apr@cn-eng.de>:
> commit e7c706b1e5ccf28eaaf76c7a4613e80b0ca52863 migrated the allocation
> of struct mc13xxx to devm_* functions, but left a kfree(mc13xxx) in the
> mc13xxx_common_init error path. Remove it to prevent memory corruption.
>
> Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>

Reviewed-by: Axel Lin <axel.lin@gmail.com>

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

* Re: [PATCH] mfd: Use devm_* APIs for mc13xxx: remove leftover kfree
  2012-09-17 16:17 [PATCH] mfd: Use devm_* APIs for mc13xxx: remove leftover kfree Andreas Pretzsch
  2012-09-18  0:58 ` Axel Lin
@ 2012-09-19 11:28 ` Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Ortiz @ 2012-09-19 11:28 UTC (permalink / raw)
  To: Andreas Pretzsch; +Cc: Axel Lin, linux-kernel

Hi Andreas,

On Mon, Sep 17, 2012 at 06:17:21PM +0200, Andreas Pretzsch wrote:
> commit e7c706b1e5ccf28eaaf76c7a4613e80b0ca52863 migrated the allocation
> of struct mc13xxx to devm_* functions, but left a kfree(mc13xxx) in the
> mc13xxx_common_init error path. Remove it to prevent memory corruption.
> 
> Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
> ---
>  drivers/mfd/mc13xxx-core.c |    1 -
>  1 file changed, 1 deletion(-)
Patch applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

end of thread, other threads:[~2012-09-19 11:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-17 16:17 [PATCH] mfd: Use devm_* APIs for mc13xxx: remove leftover kfree Andreas Pretzsch
2012-09-18  0:58 ` Axel Lin
2012-09-19 11:28 ` Samuel Ortiz

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).