mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
gpio: dwapb_gpio: Using wrong function to free memory
In gpio_dwapb_bind plat is used to reference memory allocated by devm_kcalloc but it is attempted to be freed using kfree. Instead free this memory using the correct devm_kfree function. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Acked-by: Quentin Schulz <quentin.schulz@cherry.de>
This commit is contained in:
committed by
Tom Rini
parent
bd644d9613
commit
916f4337d1
@@ -193,7 +193,7 @@ static int gpio_dwapb_bind(struct udevice *dev)
|
||||
ofnode_get_name(node));
|
||||
plat->name = strdup(name);
|
||||
if (!plat->name) {
|
||||
kfree(plat);
|
||||
devm_kfree(dev, plat);
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user