]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
nfsd: Avoid some useless tests
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 1 Sep 2022 05:27:11 +0000 (07:27 +0200)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 26 Sep 2022 18:02:21 +0000 (14:02 -0400)
memdup_user() can't return NULL, so there is no point for checking for it.

Simplify some tests accordingly.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4recover.c

index 8f24485e0f04f379754ce4938ab6d3fab9e8b29e..4edfc9580641225d4550d64337f880cb7de5d233 100644 (file)
@@ -807,7 +807,7 @@ __cld_pipe_inprogress_downcall(const struct cld_msg_v2 __user *cmsg,
                        if (get_user(namelen, &ci->cc_name.cn_len))
                                return -EFAULT;
                        name.data = memdup_user(&ci->cc_name.cn_id, namelen);
-                       if (IS_ERR_OR_NULL(name.data))
+                       if (IS_ERR(name.data))
                                return -EFAULT;
                        name.len = namelen;
                        get_user(princhashlen, &ci->cc_princhash.cp_len);
@@ -815,7 +815,7 @@ __cld_pipe_inprogress_downcall(const struct cld_msg_v2 __user *cmsg,
                                princhash.data = memdup_user(
                                                &ci->cc_princhash.cp_data,
                                                princhashlen);
-                               if (IS_ERR_OR_NULL(princhash.data)) {
+                               if (IS_ERR(princhash.data)) {
                                        kfree(name.data);
                                        return -EFAULT;
                                }
@@ -829,7 +829,7 @@ __cld_pipe_inprogress_downcall(const struct cld_msg_v2 __user *cmsg,
                        if (get_user(namelen, &cnm->cn_len))
                                return -EFAULT;
                        name.data = memdup_user(&cnm->cn_id, namelen);
-                       if (IS_ERR_OR_NULL(name.data))
+                       if (IS_ERR(name.data))
                                return -EFAULT;
                        name.len = namelen;
                }