mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] symlink.c
@ 2001-06-13  0:08 John Martin
  2001-06-13  0:27 ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 2+ messages in thread
From: John Martin @ 2001-06-13  0:08 UTC (permalink / raw)
  To: linux-kernel, torvalds

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);
 }



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-06-13  0:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-13  0:08 [PATCH] symlink.c John Martin
2001-06-13  0:27 ` Jeremy Fitzhardinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®