bus/platform: fix resource leak
PATCH 1/1 bus/platform: fix resource leak
On error function may return without releasing some allocated resources which causes a memory leak. Fix it.
Coverity issue: 383660
Fixes 17c839f74da3 ("bus: add platform bus")
Signed-off-by Tomasz Duszynski <[email protected]>
--- drivers/bus/platform/platform_params.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/bus/platform/platform_params.c +3 -1
@@ -63,8 +63,10 @@ platform_bus_dev_iterate(const void *start, const char *str, } find_device = platform_bus.bus.find_device; -if (find_device ==NULL ) +if (find_device ==NULL ) { +rte_kvargs_free (kvargs);return NULL ; + } dev = platform_bus.bus.find_device (start, platform_dev_match, kvargs);rte_kvargs_free (kvargs);
Signature · 1 line
2.34.1
Thomas Monjalon
Applied16/03/2023 09:14, Tomasz Duszynski:
Quoted 7 lines
On error function may return without releasing some allocated resources which causes a memory leak. Fix it.
Coverity issue: 383660
Fixes 17c839f74da3 ("bus: add platform bus")Signed-off-by Tomasz Duszynski <[email protected]>
Applied, thanks.