From: Jean Delvare jdelvare@suse.de
[ Upstream commit c6d9c0798ed366a09a9e53d71edcd2266e34a6eb ]
Unlike release_mem_region(), a call to release_resource() does not free the resource, so it has to be freed explicitly to avoid a memory leak.
Signed-off-by: Jean Delvare jdelvare@suse.de Fixes: 0578fff4aae5 ("Watchdog: sp5100_tco: Add initialization using EFCH MMIO") Cc: Terry Bowman terry.bowman@amd.com Cc: Wim Van Sebroeck wim@linux-watchdog.org Cc: Guenter Roeck linux@roeck-us.net Reviewed-by: Guenter Roeck linux@roeck-us.net Link: https://lore.kernel.org/r/20220621152840.420a0f4c@endymion.delvare Signed-off-by: Guenter Roeck linux@roeck-us.net Signed-off-by: Wim Van Sebroeck wim@linux-watchdog.org Signed-off-by: Sasha Levin sashal@kernel.org --- drivers/watchdog/sp5100_tco.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c index 4820af929a82..4afc468d8ed1 100644 --- a/drivers/watchdog/sp5100_tco.c +++ b/drivers/watchdog/sp5100_tco.c @@ -394,6 +394,7 @@ static int sp5100_tco_setupdevice_mmio(struct device *dev, iounmap(addr);
release_resource(res); + kfree(res);
return ret; }