nfsd: recover: fix memory leak
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Mon, 7 Mar 2016 10:10:03 +0000 (15:40 +0530)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 17 Mar 2016 18:57:15 +0000 (14:57 -0400)
nfsd4_cltrack_grace_start() will allocate the memory for grace_start but
when we returned due to error we missed freeing it.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4recover.c

index dc8ebecf561866a2d6fcee729813528852be6313..a8d6a83d4216ea79248870946cd0b77e2c3623bc 100644 (file)
@@ -1260,6 +1260,7 @@ nfsd4_umh_cltrack_init(struct net *net)
        /* XXX: The usermode helper s not working in container yet. */
        if (net != &init_net) {
                pr_warn("NFSD: attempt to initialize umh client tracking in a container ignored.\n");
+               kfree(grace_start);
                return -EINVAL;
        }