Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263074
b: refs/heads/master
c: 338d0f0
h: refs/heads/master
v: v3
  • Loading branch information
Timo Warns authored and Linus Torvalds committed Aug 17, 2011
1 parent 645e0e8 commit 214970d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b4fd4ae6c6420c18e4bae2c294b7e06f5ff5210f
refs/heads/master: 338d0f0a6fbc82407864606f5b64b75aeb3c70f2
23 changes: 14 additions & 9 deletions trunk/fs/befs/linuxvfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,17 +474,22 @@ befs_follow_link(struct dentry *dentry, struct nameidata *nd)
befs_data_stream *data = &befs_ino->i_data.ds;
befs_off_t len = data->size;

befs_debug(sb, "Follow long symlink");

link = kmalloc(len, GFP_NOFS);
if (!link) {
link = ERR_PTR(-ENOMEM);
} else if (befs_read_lsymlink(sb, data, link, len) != len) {
kfree(link);
befs_error(sb, "Failed to read entire long symlink");
if (len == 0) {
befs_error(sb, "Long symlink with illegal length");
link = ERR_PTR(-EIO);
} else {
link[len - 1] = '\0';
befs_debug(sb, "Follow long symlink");

link = kmalloc(len, GFP_NOFS);
if (!link) {
link = ERR_PTR(-ENOMEM);
} else if (befs_read_lsymlink(sb, data, link, len) != len) {
kfree(link);
befs_error(sb, "Failed to read entire long symlink");
link = ERR_PTR(-EIO);
} else {
link[len - 1] = '\0';
}
}
} else {
link = befs_ino->i_data.symlink;
Expand Down

0 comments on commit 214970d

Please sign in to comment.