diff options
-rw-r--r-- | fs/9p/vfs_inode.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 2cb87ba4b1c1..8e60dc7ec4a6 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -1054,6 +1054,9 @@ static int v9fs_vfs_readlink(struct dentry *dentry, char __user * buffer, | |||
1054 | int ret; | 1054 | int ret; |
1055 | char *link = __getname(); | 1055 | char *link = __getname(); |
1056 | 1056 | ||
1057 | if (unlikely(!link)) | ||
1058 | return -ENOMEM; | ||
1059 | |||
1057 | if (buflen > PATH_MAX) | 1060 | if (buflen > PATH_MAX) |
1058 | buflen = PATH_MAX; | 1061 | buflen = PATH_MAX; |
1059 | 1062 | ||
@@ -1227,6 +1230,9 @@ v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir, | |||
1227 | } | 1230 | } |
1228 | 1231 | ||
1229 | name = __getname(); | 1232 | name = __getname(); |
1233 | if (unlikely(!name)) | ||
1234 | return -ENOMEM; | ||
1235 | |||
1230 | sprintf(name, "%d\n", oldfid->fid); | 1236 | sprintf(name, "%d\n", oldfid->fid); |
1231 | retval = v9fs_vfs_mkspecial(dir, dentry, V9FS_DMLINK, name); | 1237 | retval = v9fs_vfs_mkspecial(dir, dentry, V9FS_DMLINK, name); |
1232 | __putname(name); | 1238 | __putname(name); |