projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6df200f
)
pNFS: Handle allocation errors correctly in objlayout_alloc_layout_hdr()
author
Trond Myklebust
<
[email protected]
>
Fri, 30 May 2014 00:17:17 +0000
(20:17 -0400)
committer
Trond Myklebust
<
[email protected]
>
Fri, 30 May 2014 00:17:17 +0000
(20:17 -0400)
Return the NULL pointer when the allocation fails.
Cc: Boaz Harrosh <
[email protected]
>
Signed-off-by: Trond Myklebust <
[email protected]
>
fs/nfs/objlayout/objlayout.c
patch
|
blob
|
history
diff --git
a/fs/nfs/objlayout/objlayout.c
b/fs/nfs/objlayout/objlayout.c
index 2f955f671003852095c901526ee59e981634e617..765d3f54e9860b18404dea42a757f899966ccda8 100644
(file)
--- a/
fs/nfs/objlayout/objlayout.c
+++ b/
fs/nfs/objlayout/objlayout.c
@@
-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) {
-
spin_lock_init(&objlay->lock)
;
-
INIT_LIST_HEAD(&objlay->err_list
);
- }
+ 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;
}