summaryrefslogtreecommitdiff
path: root/fs/udf/namei.c
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2015-04-08 22:23:51 +0300
committerJan Kara <jack@suse.cz>2015-05-18 12:23:03 +0300
commit5ceb8b554dcaaf6844415cd2616ce2e0132530fa (patch)
treec80877de890e6f3ab8d47aae705d39401031efb8 /fs/udf/namei.c
parentc0655fe9b0901a968800f56687be3c62b4cce5d2 (diff)
downloadlinux-5ceb8b554dcaaf6844415cd2616ce2e0132530fa.tar.xz
udf: Return -ENOMEM when allocation fails in udf_get_filename()
Return -ENOMEM when allocation fails in udf_get_filename(). Update udf_pc_to_char(), udf_readdir(), and udf_find_entry() to handle the error appropriately. This allows us to pass appropriate error to userspace instead of corrupting symlink contents by omitting some path elements. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/namei.c')
-rw-r--r--fs/udf/namei.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 5c03f0dfb98b..51b1c31b55c8 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -234,7 +234,7 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir,
continue;
flen = udf_get_filename(sb, nameptr, lfi, fname, UDF_NAME_LEN);
- if (flen && udf_match(flen, fname, child->len, child->name))
+ if (flen > 0 && udf_match(flen, fname, child->len, child->name))
goto out_ok;
}