* [PATCH] 9pfs: missing result check in v9fs_vfs_readlink() and v9fs_vfs_link()
@ 2006-06-08 5:40 Florin Malita
2006-06-08 13:54 ` Eric Van Hensbergen
0 siblings, 1 reply; 2+ messages in thread
From: Florin Malita @ 2006-06-08 5:40 UTC (permalink / raw)
To: ericvh, rminnich, lucho; +Cc: linux-kernel, akpm
__getname() may fail and return NULL (as pointed out by Coverity 437 &
1220).
Signed-off-by: Florin Malita <fmalita@gmail.com>
---
fs/9p/vfs_inode.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 2cb87ba..8e60dc7 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -1054,6 +1054,9 @@ static int v9fs_vfs_readlink(struct dent
int ret;
char *link = __getname();
+ if (unlikely(!link))
+ return -ENOMEM;
+
if (buflen > PATH_MAX)
buflen = PATH_MAX;
@@ -1227,6 +1230,9 @@ v9fs_vfs_link(struct dentry *old_dentry,
}
name = __getname();
+ if (unlikely(!name))
+ return -ENOMEM;
+
sprintf(name, "%d\n", oldfid->fid);
retval = v9fs_vfs_mkspecial(dir, dentry, V9FS_DMLINK, name);
__putname(name);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-08 13:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-08 5:40 [PATCH] 9pfs: missing result check in v9fs_vfs_readlink() and v9fs_vfs_link() Florin Malita
2006-06-08 13:54 ` Eric Van Hensbergen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox