]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] OProfile: fix d_path() usage
authorJohn Levon <levon@movementarian.org>
Sun, 25 May 2003 14:43:05 +0000 (07:43 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 25 May 2003 14:43:05 +0000 (07:43 -0700)
d_path() can return -ENAMETOOLONG these days. Pass it upstream.

fs/dcookies.c

index 7365acccf39119b3659530a01020ead23e865303..277ef25dff5433037d8bb345416394d0264661f1 100644 (file)
@@ -175,6 +175,11 @@ asmlinkage long sys_lookup_dcookie(u64 cookie64, char * buf, size_t len)
        /* FIXME: (deleted) ? */
        path = d_path(dcs->dentry, dcs->vfsmnt, kbuf, PAGE_SIZE);
 
+       if (IS_ERR(path)) {
+               err = PTR_ERR(path);
+               goto out_free;
+       }
+
        err = -ERANGE;
  
        pathlen = kbuf + PAGE_SIZE - path;
@@ -184,6 +189,7 @@ asmlinkage long sys_lookup_dcookie(u64 cookie64, char * buf, size_t len)
                        err = -EFAULT;
        }
 
+out_free:
        kfree(kbuf);
 out:
        up(&dcookie_sem);