]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/nfsd/export.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
[linux-2.6-omap-h63xx.git] / fs / nfsd / export.c
index 676201dbdf84308a22c479e2523d2e8401388676..5839b229cd0ea9bbd631441b89a07e639be0a98f 100644 (file)
@@ -99,7 +99,7 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
        int fsidtype;
        char *ep;
        struct svc_expkey key;
-       struct svc_expkey *ek;
+       struct svc_expkey *ek = NULL;
 
        if (mesg[mlen-1] != '\n')
                return -EINVAL;
@@ -107,7 +107,8 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
 
        buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
        err = -ENOMEM;
-       if (!buf) goto out;
+       if (!buf)
+               goto out;
 
        err = -EINVAL;
        if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
@@ -151,16 +152,16 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
 
        /* now we want a pathname, or empty meaning NEGATIVE  */
        err = -EINVAL;
-       if ((len=qword_get(&mesg, buf, PAGE_SIZE)) < 0)
+       len = qword_get(&mesg, buf, PAGE_SIZE);
+       if (len < 0)
                goto out;
        dprintk("Path seems to be <%s>\n", buf);
        err = 0;
        if (len == 0) {
                set_bit(CACHE_NEGATIVE, &key.h.flags);
                ek = svc_expkey_update(&key, ek);
-               if (ek)
-                       cache_put(&ek->h, &svc_expkey_cache);
-               else err = -ENOMEM;
+               if (!ek)
+                       err = -ENOMEM;
        } else {
                err = kern_path(buf, 0, &key.ek_path);
                if (err)
@@ -169,14 +170,14 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
                dprintk("Found the path %s\n", buf);
 
                ek = svc_expkey_update(&key, ek);
-               if (ek)
-                       cache_put(&ek->h, &svc_expkey_cache);
-               else
+               if (!ek)
                        err = -ENOMEM;
                path_put(&key.ek_path);
        }
        cache_flush();
  out:
+       if (ek)
+               cache_put(&ek->h, &svc_expkey_cache);
        if (dom)
                auth_domain_put(dom);
        kfree(buf);