nfsd: remove some unneeded checks
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 20 Jan 2012 07:48:18 +0000 (10:48 +0300)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 3 Feb 2012 19:26:42 +0000 (14:26 -0500)
We check for zero length strings in the caller now, so these aren't
needed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/export.c
net/sunrpc/svcauth_unix.c

index cf8a6bd062fa9dc4eccdf3ecc464d83b2a8a6366..8e9689abbc0c7594fb6aa6cb7fb7735018165162 100644 (file)
@@ -87,7 +87,7 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
        struct svc_expkey key;
        struct svc_expkey *ek = NULL;
 
-       if (mlen < 1 || mesg[mlen-1] != '\n')
+       if (mesg[mlen - 1] != '\n')
                return -EINVAL;
        mesg[mlen-1] = 0;
 
index 01153ead1dbaf3d982e4d57bfacccce674b507a4..6ab35736d88fa1e5179583a18830b8f2c45c96c4 100644 (file)
@@ -509,7 +509,7 @@ static int unix_gid_parse(struct cache_detail *cd,
        time_t expiry;
        struct unix_gid ug, *ugp;
 
-       if (mlen <= 0 || mesg[mlen-1] != '\n')
+       if (mesg[mlen - 1] != '\n')
                return -EINVAL;
        mesg[mlen-1] = 0;