Explorar o código

lockd: handle lockowner allocation failure in nlmclnt_proc()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro %!s(int64=13) %!d(string=hai) anos
pai
achega
bf8848918d
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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);