]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
NTB: ntb_tool: fix memory leak on 'buf' on error exit path
authorColin Ian King <colin.king@canonical.com>
Mon, 22 Jan 2018 09:38:57 +0000 (09:38 +0000)
committerJon Mason <jdmason@kudzu.us>
Mon, 29 Jan 2018 03:17:24 +0000 (22:17 -0500)
commit2e2bc5a9a300261853303c006b7c29faafc64221
tree8fd676caf858363541e4d64130bda58c9faa0047
parent1536dc063e82090c5da65ddd94b1da1b38bfab43
NTB: ntb_tool: fix memory leak on 'buf' on error exit path

Currently there is a memory leak on buf when the call to ntb_mw_get_align
fails.  Add an exit err label and jump to this so that kfree on buf frees
the memory.

Detected by CoverityScan, CID#1464286 ("Resource leak")

Fixes: d637628ce00c ("NTB: ntb_tool: Add full multi-port NTB API support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/test/ntb_tool.c