浏览代码

lockd: handle lockowner allocation failure in nlmclnt_proc()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro 13 年之前
父节点
当前提交
bf8848918d
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      fs/lockd/clntproc.c

+ 5 - 0
fs/lockd/clntproc.c

@@ -161,6 +161,11 @@ int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl)
 		return -ENOMEM;
 
 	nlmclnt_locks_init_private(fl, host);
+	if (!fl->fl_u.nfs_fl.owner) {
+		/* lockowner allocation has failed */
+		nlmclnt_release_call(call);
+		return -ENOMEM;
+	}
 	/* Set up the argument struct */
 	nlmclnt_setlockargs(call, fl);