lkml.org 
[lkml]   [2013]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 05/11] seq_file: Handle ->next error in seq_read
Date
From: Andi Kleen <ak@linux.intel.com>

When ->next fails the error would not be returned to user space.
Add the missing check.

Cc: viro@zeniv.linux.org.uk
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
fs/seq_file.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fs/seq_file.c b/fs/seq_file.c
index 3135c25..e16b4a8 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -262,6 +262,8 @@ Fill:
pos = next;
}
m->op->stop(m, p);
+ if (err)
+ goto Done;
n = min(m->count, size);
err = copy_to_user(buf, m->buf, n);
if (err)
--
1.8.3.1


\
 
 \ /
  Last update: 2013-10-01 01:41    [W:0.190 / U:0.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site