Skip to content

Commit

Permalink
drivers: mcb: fix memory leak in chameleon_parse_cells() error path
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Christoph Jaeger authored and Greg Kroah-Hartman committed Apr 16, 2014
1 parent 34ec436 commit 7c73528
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mcb/mcb-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 7c73528

Please sign in to comment.