mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
pNFS: Handle allocation errors correctly in filelayout_alloc_layout_hdr()
commit 6df200f5d5 upstream.
Return the NULL pointer when the allocation fails.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
fe5320465f
commit
a01b18de19
@@ -1330,7 +1330,7 @@ filelayout_alloc_layout_hdr(struct inode *inode, gfp_t gfp_flags)
|
||||
struct nfs4_filelayout *flo;
|
||||
|
||||
flo = kzalloc(sizeof(*flo), gfp_flags);
|
||||
return &flo->generic_hdr;
|
||||
return flo != NULL ? &flo->generic_hdr : NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user