Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0aa61e78 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

pNFS: Handle allocation errors correctly in objlayout_alloc_layout_hdr()



Return the NULL pointer when the allocation fails.

Cc: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 6df200f5
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -53,10 +53,10 @@ objlayout_alloc_layout_hdr(struct inode *inode, gfp_t gfp_flags)
	struct objlayout *objlay;

	objlay = kzalloc(sizeof(struct objlayout), gfp_flags);
	if (objlay) {
	if (!objlay)
		return NULL;
	spin_lock_init(&objlay->lock);
	INIT_LIST_HEAD(&objlay->err_list);
	}
	dprintk("%s: Return %p\n", __func__, objlay);
	return &objlay->pnfs_layout;
}