From: Andrew Goodbody Date: Fri, 25 Jul 2025 11:48:22 +0000 (+0100) Subject: gpio: dwapb_gpio: Using wrong function to free memory X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=916f4337d1d3db4d16040abff39a5f4419589ead;p=thirdparty%2Fu-boot.git 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 Acked-by: Quentin Schulz --- diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index 04639a4cb68..7ab48780332 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -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; } }