NFS: remove unneeded check in decode_devicenotify_args()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Tue, 15 Feb 2022 10:17:04 +0000 (13:17 +0300)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sun, 13 Mar 2022 16:59:34 +0000 (12:59 -0400)
[You don't often get email from khoroshilov@ispras.ru. Learn why this is important at http://aka.ms/LearnAboutSenderIdentification.]

Overflow check in not needed anymore after we switch to kmalloc_array().

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Fixes: a4f743a6bb20 ("NFSv4.1: Convert open-coded array allocation calls to kmalloc_array()")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/callback_xdr.c

index f90de80..8dcb08e 100644 (file)
@@ -271,10 +271,6 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
        n = ntohl(*p++);
        if (n == 0)
                goto out;
-       if (n > ULONG_MAX / sizeof(*args->devs)) {
-               status = htonl(NFS4ERR_BADXDR);
-               goto out;
-       }
 
        args->devs = kmalloc_array(n, sizeof(*args->devs), GFP_KERNEL);
        if (!args->devs) {