9pfs: fix memory leak in v9fs_link
PATCH 1/1 9pfs: fix memory leak in v9fs_link
From: Li Qiang <[email protected]>
In v9fs_link dispatch function, it doesn't put the 'oldfidp' fid object, this will make the 'oldfidp->ref' never reach to 0, thus leading a memory leak issue. This patch fix this.
Signed-off-by Li Qiang <[email protected]>
--- hw/9pfs/9p.c | 1 + 1 file changed, 1 insertion(+)
hw/9pfs/9p.c +1 -0
@@ -2413,6 +2413,7 @@ static void v9fs_link(void *opaque)if (!err) { err = offset; } +put_fid (pdu, oldfidp); out:put_fid (pdu, dfidp); out_nofid:
Signature · 1 line
1.8.3.1
Quoted 8 lines · On Wed, 12 Oct 2016 00:12:48 -0700 Li Qiang <[email protected]> wrote:
From: Li Qiang <[email protected]>
In
v9fs_linkdispatch function, it doesn't put the 'oldfidp' fid object, this will make the 'oldfidp->ref' never reach to 0, thus leading a memory leak issue. This patch fix this.Signed-off-by Li Qiang <[email protected]>---
Good catch!
Reviewed-by Greg Kurz <[email protected]>
Quoted 15 lines
hw/9pfs/9p.c | 1 + 1 file changed, 1 insertion(+)hw/9pfs/9p.c +1
-0@@ -2413,6 +2413,7 @@ static void v9fs_link(void *opaque)if (!err) { err = offset; } +put_fid (pdu, oldfidp); out:put_fid (pdu, dfidp); out_nofid: