mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
mtd: nand: pxa3xx: Free memory on error
In pxa3xx_nand_probe_dt if the function detects an error after allocating memory that memory is not freed before exit. Add the appropriate free. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: MIchael Trimarchi <michael@amarulasolutions.com>
This commit is contained in:
committed by
Michael Trimarchi
parent
ae5711f881
commit
42ef9a0b7f
@@ -1765,6 +1765,7 @@ static int pxa3xx_nand_probe_dt(struct udevice *dev, struct pxa3xx_nand_info *in
|
||||
pdata->num_cs = dev_read_u32_default(dev, "num-cs", 1);
|
||||
if (pdata->num_cs != 1) {
|
||||
pr_err("pxa3xx driver supports single CS only\n");
|
||||
kfree(pdata);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user