linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: mcb: fix memory leak in chameleon_parse_cells() error path
@ 2014-04-04 19:04 Christoph Jaeger
  2014-04-07 14:02 ` Johannes Thumshirn
  2014-04-10  6:16 ` Johannes Thumshirn
  0 siblings, 2 replies; 5+ messages in thread
From: Christoph Jaeger @ 2014-04-04 19:04 UTC (permalink / raw)
  To: johannes.thumshirn; +Cc: linux-kernel, Christoph Jaeger

chameleon_parse_cells() bails out if chameleon descriptor type is
invalid but does not free the storage 'header' points to.

Signed-off-by: Christoph Jaeger <christophjaeger@linux.com>
---
 drivers/mcb/mcb-parse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c
index d1278b5..0049269 100644
--- a/drivers/mcb/mcb-parse.c
+++ b/drivers/mcb/mcb-parse.c
@@ -141,6 +141,7 @@ int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase,
 		default:
 			pr_err("Invalid chameleon descriptor type 0x%x\n",
 				dtype);
+			kfree(header);
 			return -EINVAL;
 		}
 		num_cells++;
-- 
1.9.0


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

* Re: [PATCH] drivers: mcb: fix memory leak in chameleon_parse_cells() error path
  2014-04-04 19:04 [PATCH] drivers: mcb: fix memory leak in chameleon_parse_cells() error path Christoph Jaeger
@ 2014-04-07 14:02 ` Johannes Thumshirn
  2014-04-07 16:31   ` Greg Kroah-Hartman
  2014-04-10  6:16 ` Johannes Thumshirn
  1 sibling, 1 reply; 5+ messages in thread
From: Johannes Thumshirn @ 2014-04-07 14:02 UTC (permalink / raw)
  To: Christoph Jaeger, Greg Kroah-Hartman; +Cc: johannes.thumshirn, linux-kernel

On Fri, Apr 04, 2014 at 09:04:58PM +0200, Christoph Jaeger wrote:
> chameleon_parse_cells() bails out if chameleon descriptor type is
> invalid but does not free the storage 'header' points to.
>
> Signed-off-by: Christoph Jaeger <christophjaeger@linux.com>
> ---
>  drivers/mcb/mcb-parse.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c
> index d1278b5..0049269 100644
> --- a/drivers/mcb/mcb-parse.c
> +++ b/drivers/mcb/mcb-parse.c
> @@ -141,6 +141,7 @@ int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase,
>  		default:
>  			pr_err("Invalid chameleon descriptor type 0x%x\n",
>  				dtype);
> +			kfree(header);
>  			return -EINVAL;
>  		}
>  		num_cells++;
> --
> 1.9.0
>

*Doh*

Thanks for the patch.

@Greg, how should be the process here? Should I collect MCB related patches
somewhere and forward them to you, or do you pick them up yourself?

Thanks,
	Johannes

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

* Re: [PATCH] drivers: mcb: fix memory leak in chameleon_parse_cells() error path
  2014-04-07 14:02 ` Johannes Thumshirn
@ 2014-04-07 16:31   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2014-04-07 16:31 UTC (permalink / raw)
  To: Johannes Thumshirn; +Cc: Christoph Jaeger, linux-kernel

On Mon, Apr 07, 2014 at 04:02:06PM +0200, Johannes Thumshirn wrote:
> On Fri, Apr 04, 2014 at 09:04:58PM +0200, Christoph Jaeger wrote:
> > chameleon_parse_cells() bails out if chameleon descriptor type is
> > invalid but does not free the storage 'header' points to.
> >
> > Signed-off-by: Christoph Jaeger <christophjaeger@linux.com>
> > ---
> >  drivers/mcb/mcb-parse.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c
> > index d1278b5..0049269 100644
> > --- a/drivers/mcb/mcb-parse.c
> > +++ b/drivers/mcb/mcb-parse.c
> > @@ -141,6 +141,7 @@ int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase,
> >  		default:
> >  			pr_err("Invalid chameleon descriptor type 0x%x\n",
> >  				dtype);
> > +			kfree(header);
> >  			return -EINVAL;
> >  		}
> >  		num_cells++;
> > --
> > 1.9.0
> >
> 
> *Doh*
> 
> Thanks for the patch.
> 
> @Greg, how should be the process here? Should I collect MCB related patches
> somewhere and forward them to you, or do you pick them up yourself?

Please collect them up and forward them on to me, that's what a
maintainer's job is :)

thanks,

greg k-h

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

* Re: [PATCH] drivers: mcb: fix memory leak in chameleon_parse_cells() error path
  2014-04-04 19:04 [PATCH] drivers: mcb: fix memory leak in chameleon_parse_cells() error path Christoph Jaeger
  2014-04-07 14:02 ` Johannes Thumshirn
@ 2014-04-10  6:16 ` Johannes Thumshirn
  1 sibling, 0 replies; 5+ messages in thread
From: Johannes Thumshirn @ 2014-04-10  6:16 UTC (permalink / raw)
  To: Christoph Jaeger; +Cc: johannes.thumshirn, linux-kernel

On Fri, Apr 04, 2014 at 09:04:58PM +0200, Christoph Jaeger wrote:
> chameleon_parse_cells() bails out if chameleon descriptor type is
> invalid but does not free the storage 'header' points to.
>
> Signed-off-by: Christoph Jaeger <christophjaeger@linux.com>
> ---
>  drivers/mcb/mcb-parse.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c
> index d1278b5..0049269 100644
> --- a/drivers/mcb/mcb-parse.c
> +++ b/drivers/mcb/mcb-parse.c
> @@ -141,6 +141,7 @@ int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase,
>  		default:
>  			pr_err("Invalid chameleon descriptor type 0x%x\n",
>  				dtype);
> +			kfree(header);
>  			return -EINVAL;
>  		}
>  		num_cells++;
> --
> 1.9.0
>

Hi,

Your patch has been applied to my repo located at:

https://github.com/morbidrsa/linux/tree/mcb

or

git://github.com/morbidrsa/linux.git

Thanks,
	Johannes

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

* [PATCH] drivers: mcb: fix memory leak in chameleon_parse_cells() error path
@ 2014-04-11 16:40 Johannes Thumshirn
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Thumshirn @ 2014-04-11 16:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Johannes Thumshirn, Christoph Jaeger,
	Johannes Thumshirn

From: Christoph Jaeger <christophjaeger@linux.com>

chameleon_parse_cells() bails out if chameleon descriptor type is
invalid but does not free the storage 'header' points to.

Signed-off-by: Christoph Jaeger <christophjaeger@linux.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de>
---
 drivers/mcb/mcb-parse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c
index d1278b5..0049269 100644
--- a/drivers/mcb/mcb-parse.c
+++ b/drivers/mcb/mcb-parse.c
@@ -141,6 +141,7 @@ int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase,
 		default:
 			pr_err("Invalid chameleon descriptor type 0x%x\n",
 				dtype);
+			kfree(header);
 			return -EINVAL;
 		}
 		num_cells++;
-- 
1.9.1


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

end of thread, other threads:[~2014-04-11 16:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-04 19:04 [PATCH] drivers: mcb: fix memory leak in chameleon_parse_cells() error path Christoph Jaeger
2014-04-07 14:02 ` Johannes Thumshirn
2014-04-07 16:31   ` Greg Kroah-Hartman
2014-04-10  6:16 ` Johannes Thumshirn
  -- strict thread matches above, loose matches on Subject: below --
2014-04-11 16:40 Johannes Thumshirn

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