Discussion:
[PATCH] seq_file: Remove pointless assignment in seq_read()
Jan Kara
2014-10-21 15:12:03 UTC
Permalink
The value assigned to 'err' in seq_read() is overwritten by the result
of copy_to_user(). This is correct because we know we have succeeded to
generate at least one entry into user buffer so the error we got when
generating further entries is irrelevant. Just remove the assignment.

Coverity-id: 1226981
Signed-off-by: Jan Kara <***@suse.cz>
---
fs/seq_file.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/seq_file.c b/fs/seq_file.c
index 3857b720cb1b..cf53252e4784 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -262,10 +262,8 @@ Fill:
size_t offs = m->count;
loff_t next = pos;
p = m->op->next(m, p, &next);
- if (!p || IS_ERR(p)) {
- err = PTR_ERR(p);
+ if (!p || IS_ERR(p))
break;
- }
err = m->op->show(m, p);
if (seq_overflow(m) || err) {
m->count = offs;
--
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...