[PATCH] symlink.c

From: John Martin (suntzu@stanford.edu)
Date: Tue Jun 12 2001 - 19:08:29 EST


this patch adds a check to make sure memory was allocated, returns an
error code otherwise.
   -john

--- fs/autofs4/symlink.c.orig Fri Apr 21 14:41:36 2000
+++ fs/autofs4/symlink.c Sun Jun 3 00:43:18 2001
@@ -15,13 +15,15 @@
 static int autofs4_readlink(struct dentry *dentry, char *buffer, int
buflen)
 {
        struct autofs_info *ino = autofs4_dentry_ino(dentry);
-
        return vfs_readlink(dentry, buffer, buflen, ino->u.symlink);
 }

 static int autofs4_follow_link(struct dentry *dentry, struct nameidata
*nd)
 {
        struct autofs_info *ino = autofs4_dentry_ino(dentry);
+
+ if(!ino)
+ return -ENOMEM;

        return vfs_follow_link(nd, ino->u.symlink);
 }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 15 2001 - 21:00:16 EST