diff options
| author | Andrew Goodbody <[email protected]> | 2025-07-25 12:48:22 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-08-11 15:11:22 -0600 |
| commit | 916f4337d1d3db4d16040abff39a5f4419589ead (patch) | |
| tree | 156eed22e9955a8bb2c62c59bb147386e246fcb7 | |
| parent | bd644d9613ee0cdc3bd2ac3bc7bcc52b09d821e7 (diff) | |
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 <[email protected]>
Acked-by: Quentin Schulz <[email protected]>
| -rw-r--r-- | drivers/gpio/dwapb_gpio.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } } |
