[PATCH] symlink.c

John Martin (suntzu@stanford.edu)
Tue, 12 Jun 2001 17:08:29 -0700 (PDT)


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/