aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mcb
diff options
context:
space:
mode:
authorChristoph Jaeger <christophjaeger@linux.com>2014-04-11 12:40:05 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-16 15:28:47 -0400
commit7c7352827343b377446bb59b844d387df665e401 (patch)
tree3fc5e2cac5caaa9979557530f0025885ad500712 /drivers/mcb
parent34ec43661fe8f1977dd0f05353302ae2ed10aabb (diff)
drivers: mcb: fix memory leak in chameleon_parse_cells() error path
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>
Diffstat (limited to 'drivers/mcb')
-rw-r--r--drivers/mcb/mcb-parse.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c
index d1278b5f3028..004926955263 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,
141 default: 141 default:
142 pr_err("Invalid chameleon descriptor type 0x%x\n", 142 pr_err("Invalid chameleon descriptor type 0x%x\n",
143 dtype); 143 dtype);
144 kfree(header);
144 return -EINVAL; 145 return -EINVAL;
145 } 146 }
146 num_cells++; 147 num_cells++;