]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/nfsd/nfs4idmap.c
knfsd: fix broken length check in nfs4idmap.c
[linux-2.6-omap-h63xx.git] / fs / nfsd / nfs4idmap.c
index 4c0c683ce07a8be9852f06370dfad35d3591a45a..5b56c77c15c568b362526bbf9c6338daf29fe0a9 100644 (file)
@@ -255,13 +255,10 @@ idtoname_parse(struct cache_detail *cd, char *buf, int buflen)
                goto out;
        if (len == 0)
                set_bit(CACHE_NEGATIVE, &ent.h.flags);
-       else {
-               if (error >= IDMAP_NAMESZ) {
-                       error = -EINVAL;
-                       goto out;
-               }
+       else if (len >= IDMAP_NAMESZ)
+               goto out;
+       else
                memcpy(ent.name, buf1, sizeof(ent.name));
-       }
        error = -ENOMEM;
        res = idtoname_update(&ent, res);
        if (res == NULL)