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:
Andrew Goodbody
2025-07-25 12:48:22 +01:00
committed by Tom Rini
parent bd644d9613
commit 916f4337d1

View File

@@ -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;
}
}