nfs: fix unlikely memory leak
authorDan Carpenter <error27@gmail.com>
Sat, 6 Mar 2010 12:02:22 +0000 (15:02 +0300)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 8 Mar 2010 19:10:00 +0000 (14:10 -0500)
I'll admit that it's unlikely for the first allocation to fail and
the second one to succeed.  I won't be offended if you ignore this
patch.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4proc.c

index eda74c4..f9254fb 100644 (file)
@@ -5107,6 +5107,7 @@ static int nfs41_proc_async_sequence(struct nfs_client *clp,
        res = kzalloc(sizeof(*res), GFP_KERNEL);
        if (!args || !res) {
                kfree(args);
+               kfree(res);
                nfs_put_client(clp);
                return -ENOMEM;
        }