Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-12511 ldlm: free resource when ldlm_lock_create() fails.
[fs/lustre-release.git]
/
lustre
/
ldlm
/
ldlm_lock.c
diff --git
a/lustre/ldlm/ldlm_lock.c
b/lustre/ldlm/ldlm_lock.c
index
d9b1ca2
..
3ceadc9
100644
(file)
--- a/
lustre/ldlm/ldlm_lock.c
+++ b/
lustre/ldlm/ldlm_lock.c
@@
-1672,8
+1672,10
@@
struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
RETURN(ERR_CAST(res));
lock = ldlm_lock_new(res);
- if (lock == NULL)
+ if (!lock) {
+ ldlm_resource_putref(res);
RETURN(ERR_PTR(-ENOMEM));
+ }
lock->l_req_mode = mode;
lock->l_ast_data = data;