From 18caac5736279f548f9543e78161d0f2f4adc9d0 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 19 Sep 2012 15:56:23 -0700 Subject: [PATCH] --- yaml --- r: 323030 b: refs/heads/master c: 35b1da4e1e1026b5195649170dfb9ebb52f808e0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/input/touchscreen/edt-ft5x06.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index e46c382fe2a9..7eea37e8930b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 30ebb7fa0e3e92145b859ad6e44aa6dc636b4103 +refs/heads/master: 35b1da4e1e1026b5195649170dfb9ebb52f808e0 diff --git a/trunk/drivers/input/touchscreen/edt-ft5x06.c b/trunk/drivers/input/touchscreen/edt-ft5x06.c index b06a5e3a665e..64957770b522 100644 --- a/trunk/drivers/input/touchscreen/edt-ft5x06.c +++ b/trunk/drivers/input/touchscreen/edt-ft5x06.c @@ -566,9 +566,12 @@ static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file, } read = min_t(size_t, count, tsdata->raw_bufsize - *off); - error = copy_to_user(buf, tsdata->raw_buffer + *off, read); - if (!error) - *off += read; + if (copy_to_user(buf, tsdata->raw_buffer + *off, read)) { + error = -EFAULT; + goto out; + } + + *off += read; out: mutex_unlock(&tsdata->mutex); return error ?: read;