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 <jack@xxxxxxx> --- 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 dbf3a59c86bb..548f78308e2a 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -255,10 +255,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_has_overflowed(m) || err) { m->count = offs; -- 2.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html