Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pNFS: Handle allocation errors correctly in filelayout_alloc_layout_hdr()

Return the NULL pointer when the allocation fails.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: <stable@vger.kernel.org> # 3.5.x
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>

+1 -1
+1 -1
fs/nfs/nfs4filelayout.c
··· 1348 1348 struct nfs4_filelayout *flo; 1349 1349 1350 1350 flo = kzalloc(sizeof(*flo), gfp_flags); 1351 - return &flo->generic_hdr; 1351 + return flo != NULL ? &flo->generic_hdr : NULL; 1352 1352 } 1353 1353 1354 1354 static void