]> git.baikalelectronics.ru Git - kernel.git/commitdiff
NFSv4/pnfs: Handle RPC allocation errors in nfs4_proc_layoutget
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 7 Apr 2022 02:33:19 +0000 (22:33 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 7 Apr 2022 20:20:00 +0000 (16:20 -0400)
If rpc_run_task() fails due to an allocation error, then bail out early.

Fixes: ec7b96672dbd ("NFS: Fix memory allocation in rpc_alloc_task()")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs4proc.c

index e3f5b380cefe95e39ddf0151bdabc3004a27b544..16106f805ffa21a41f7833247c5f019924f4d537 100644 (file)
@@ -9615,6 +9615,8 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, long *timeout)
        nfs4_init_sequence(&lgp->args.seq_args, &lgp->res.seq_res, 0, 0);
 
        task = rpc_run_task(&task_setup_data);
+       if (IS_ERR(task))
+               return ERR_CAST(task);
 
        status = rpc_wait_for_completion_task(task);
        if (status != 0)