9pfs: fix memory leak in v9fs_link

The v9fs_link() function keeps a reference on the source fid object. This
causes a memory leak since the reference never goes down to 0. This patch
fixes the issue.

Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Reviewed-by: Greg Kurz <groug@kaod.org>
[groug, rephrased the changelog]
Signed-off-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
Li Qiang 2016-10-17 14:13:58 +02:00 committed by Greg Kurz
parent ff55e94d23
commit 4c1586787f
1 changed files with 1 additions and 0 deletions

View File

@ -2413,6 +2413,7 @@ static void coroutine_fn v9fs_link(void *opaque)
if (!err) {
err = offset;
}
put_fid(pdu, oldfidp);
out:
put_fid(pdu, dfidp);
out_nofid: