lkml.org 
[lkml]   [2014]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drivers: mcb: fix memory leak in chameleon_parse_cells() error path
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


\
 
 \ /
  Last update: 2014-04-07 16:41    [W:0.037 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site