diff options
author | Ravi Jain <raviajain@google.com> | 2023-06-05 12:52:06 +0800 |
---|---|---|
committer | Ravi Jain <raviajain@google.com> | 2023-06-07 07:13:07 +0000 |
commit | c039521f13476b71f5ead4d625d5fff706ac505f (patch) | |
tree | fc6f0965ca99c1e8a9daf1d2e14fe30ff44c1b6a | |
parent | 9db7315f72917445a6efb5c64a3dc144ca283449 (diff) | |
download | goodix_touch-c039521f13476b71f5ead4d625d5fff706ac505f.tar.gz |
touch: goodix: Resolve driver_test_write end char erase issue.
Removed the logic to replace last char with 0. Instead making sure that
command size is 1 less that max_size.
Bug: 283721295
Test: `adb shell touchpanel package_id`
Change-Id: I120a0121f77bc5bc8c6d6b4eb0192875ecb364cd
Signed-off-by: Ravi Jain <raviajain@google.com>
(cherry picked from commit c8de2fb3aa8bf08ab7ae286350c31422835153b9)
-rw-r--r-- | goodix_ts_proc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/goodix_ts_proc.c b/goodix_ts_proc.c index 86657b4..a4ec32d 100644 --- a/goodix_ts_proc.c +++ b/goodix_ts_proc.c @@ -3455,7 +3455,7 @@ static ssize_t driver_test_write(struct file *file, const char __user *buf, int cmd_val2; u8 id; - if (count > SHORT_SIZE) { + if (count >= SHORT_SIZE) { /* [GOOG] */ ts_err("invalid cmd size[%ld]", count); return count; } @@ -3465,7 +3465,7 @@ static ssize_t driver_test_write(struct file *file, const char __user *buf, ts_err("copy from user failed"); return count; } - p[strlen(p) - 1] = 0; + //p[strlen(p) - 1] = 0; /* [GOOG] */ vfree(rbuf); rbuf = NULL; |