lkml.org 
[lkml]   [2016]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fs: befs: remove ignored length of buffer
Date
When befs_nls2utf() returns an error, the caller ignores the length of the
output buffer since it knows the buffer isn't useful. Removing the
length assignment that will be ignored.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
---

Hi,

Noticed this while continuing to familiarize with the befs code.

As a matter of fact, the only caller of befs_nls2utf() ignores the value of
out_len even when the function succeeds. I was considering that this parameter
could be removed completely.

The only con to doing so I can think of is losing the symmetry with the
matching befs_utf2nls(). Which is why I am asking here before proposing that
patch.

Thanks,
Luis


fs/befs/linuxvfs.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 06d29a3..5c99012 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -614,7 +614,6 @@ befs_nls2utf(struct super_block *sb, const char *in,

*out = result = kmalloc(maxlen, GFP_NOFS);
if (!*out) {
- *out_len = 0;
return -ENOMEM;
}

--
2.5.1
\
 
 \ /
  Last update: 2016-06-29 21:01    [W:0.241 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site