aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/edt-ft5x06.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/edt-ft5x06.c')
-rw-r--r--drivers/input/touchscreen/edt-ft5x06.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 7b786e757ba2..099d144ab7c9 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -566,9 +566,12 @@ static ssize_t edt_ft5x06_debugfs_raw_data_read(struct file *file,
566 } 566 }
567 567
568 read = min_t(size_t, count, tsdata->raw_bufsize - *off); 568 read = min_t(size_t, count, tsdata->raw_bufsize - *off);
569 error = copy_to_user(buf, tsdata->raw_buffer + *off, read); 569 if (copy_to_user(buf, tsdata->raw_buffer + *off, read)) {
570 if (!error) 570 error = -EFAULT;
571 *off += read; 571 goto out;
572 }
573
574 *off += read;
572out: 575out:
573 mutex_unlock(&tsdata->mutex); 576 mutex_unlock(&tsdata->mutex);
574 return error ?: read; 577 return error ?: read;
@@ -602,6 +605,7 @@ edt_ft5x06_ts_teardown_debugfs(struct edt_ft5x06_ts_data *tsdata)
602{ 605{
603 if (tsdata->debug_dir) 606 if (tsdata->debug_dir)
604 debugfs_remove_recursive(tsdata->debug_dir); 607 debugfs_remove_recursive(tsdata->debug_dir);
608 kfree(tsdata->raw_buffer);
605} 609}
606 610
607#else 611#else
@@ -843,7 +847,6 @@ static int __devexit edt_ft5x06_ts_remove(struct i2c_client *client)
843 if (gpio_is_valid(pdata->reset_pin)) 847 if (gpio_is_valid(pdata->reset_pin))
844 gpio_free(pdata->reset_pin); 848 gpio_free(pdata->reset_pin);
845 849
846 kfree(tsdata->raw_buffer);
847 kfree(tsdata); 850 kfree(tsdata);
848 851
849 return 0; 852 return 0;