watchdog: sp5100_tco: Fix a memory leak of EFCH MMIO resource
PATCH 1/1 watchdog: sp5100_tco: Fix a memory leak of EFCH MMIO resource
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.
--- drivers/watchdog/sp5100_tco.c | 1 + 1 file changed, 1 insertion(+)
drivers/watchdog/sp5100_tco.c +1 -0
@@ -402,6 +402,7 @@ static int sp5100_tco_setupdevice_mmio(siounmap (addr);release_resource (res); +kfree (res);return ret; }
Signature · 2 lines
Jean Delvare SUSE L3 Support
Quoted 9 lines · Jean Delvare
Unlike
release_mem_region(), a call torelease_resource()does not free the resource, so it has to be freed explicitly to avoid a memory leak.Signed-off-by Jean Delvare <[email protected]>Fixes 0578fff4aae5 ("Watchdog: sp5100_tco: Add initialization using EFCH MMIO")Cc Terry Bowman <[email protected]>Cc Wim Van Sebroeck <[email protected]>Cc Guenter Roeck <[email protected]>
Unless I am missing something, it looks like every caller of request_mem_region_muxed() has that problem.
Guenter
Quoted 19 lines
--- drivers/watchdog/sp5100_tco.c | 1 + 1 file changed, 1 insertion(+)drivers/watchdog/sp5100_tco.c +1
-0@@ -402,6 +402,7 @@ static int sp5100_tco_setupdevice_mmio(siounmap (addr);release_resource (res); +kfree (res);return ret; }Signature · 3 lines
-- Jean Delvare SUSE L3 Support
Quoted 5 lines · Guenter Roeck
Quoted 4 lines · Jean Delvare
Unlike
release_mem_region(), a call torelease_resource()does not free the resource, so it has to be freed explicitly to avoid a memory leak.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Jean Delvare <[email protected]>Fixes 0578fff4aae5 ("Watchdog: sp5100_tco: Add initialization using EFCH MMIO")Cc Terry Bowman <[email protected]>Cc Wim Van Sebroeck <[email protected]>Cc Guenter Roeck <[email protected]>Reviewed-by Guenter Roeck <[email protected]>
Thanks.
Quoted 2 lines
Unless I am missing something, it looks like every caller of
request_mem_region_muxed()has that problem.
You are correct. Fixes have been sent for review already.
Signature · 2 lines
Jean Delvare SUSE L3 Support