浏览代码

nfsd4: fix memory leak in nfsd4_encode_fattr()

fh_put() does not free the temporary file handle.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Yan, Zheng 11 年之前
父节点
当前提交
18df11d0ea
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      fs/nfsd/nfs4xdr.c

+ 3 - 1
fs/nfsd/nfs4xdr.c

@@ -2500,8 +2500,10 @@ out:
 		security_release_secctx(context, contextlen);
 #endif /* CONFIG_NFSD_V4_SECURITY_LABEL */
 	kfree(acl);
-	if (tempfh)
+	if (tempfh) {
 		fh_put(tempfh);
+		kfree(tempfh);
+	}
 	return status;
 out_nfserr:
 	status = nfserrno(err);