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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
34ec43661f
commit
7c73528273
@@ -141,6 +141,7 @@ int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase,
|
|||||||
default:
|
default:
|
||||||
pr_err("Invalid chameleon descriptor type 0x%x\n",
|
pr_err("Invalid chameleon descriptor type 0x%x\n",
|
||||||
dtype);
|
dtype);
|
||||||
|
kfree(header);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
num_cells++;
|
num_cells++;
|
||||||
|
Reference in New Issue
Block a user