diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-10-30 08:20:56 +0100 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-10-30 08:20:56 +0100 |
commit | 53279f36dccffc26ff536003fd6bb97cc21c3b82 (patch) | |
tree | 9d16e497c0e4158c7c054c479bd0e9ff0388d7bb /drivers/input/touchscreen/edt-ft5x06.c | |
parent | Input: qt2160 - fix qt2160_write() implementation (diff) | |
parent | Linux 3.7-rc3 (diff) | |
download | linux-53279f36dccffc26ff536003fd6bb97cc21c3b82.tar.xz linux-53279f36dccffc26ff536003fd6bb97cc21c3b82.zip |
Merge tag 'v3.7-rc3' into next to sync up with recent USB and MFD changes
Diffstat (limited to 'drivers/input/touchscreen/edt-ft5x06.c')
-rw-r--r-- | drivers/input/touchscreen/edt-ft5x06.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index bcaea7a5e02b..d9c6007e445f 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -558,9 +558,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; @@ -594,6 +597,7 @@ edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata) { if (tsdata->debug_dir) debugfs_remove_recursive(tsdata->debug_dir); + kfree(tsdata->raw_buffer); } #else @@ -835,7 +839,6 @@ static int __devexit edt_ft5x06_ts_remove(struct i2c_client *client) if (gpio_is_valid(pdata->reset_pin)) gpio_free(pdata->reset_pin); - kfree(tsdata->raw_buffer); kfree(tsdata); return 0; |