lockd: handle lockowner allocation failure in nlmclnt_proc()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 29 Jul 2012 19:17:39 +0000 (23:17 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 29 Jul 2012 19:17:39 +0000 (23:17 +0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/lockd/clntproc.c

index 27c74f3..05d2912 100644 (file)
@@ -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);