hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/input/touchscreen/gsl3673.c
....@@ -408,6 +408,8 @@
408408 rc--;
409409 msleep(2);
410410 ret = gsl_ts_write(client, 0xf0, &write_buf, sizeof(write_buf));
411
+ if (ret < 0)
412
+ rc--;
411413 msleep(2);
412414 ret = gsl_ts_read(client, 0xf0, &read_buf, sizeof(read_buf));
413415 if (ret < 0)
....@@ -542,7 +544,7 @@
542544 size_t count, loff_t *data)
543545 {
544546 u8 buf[8] = {0};
545
- char temp_buf[CONFIG_LEN];
547
+ char temp_buf[CONFIG_LEN] = {0};
546548 char *path_buf;
547549 int tmp = 0;
548550 int tmp1 = 0;
....@@ -552,8 +554,10 @@
552554 return -EFAULT;
553555 }
554556 path_buf = kzalloc(count, GFP_KERNEL);
555
- if (!path_buf)
557
+ if (!path_buf) {
556558 print_info("alloc path_buf memory error\n");
559
+ return -EFAULT;
560
+ }
557561 if (copy_from_user(path_buf, buffer, count)) {
558562 print_info("copy from user fail\n");
559563 goto exit_write_proc_out;
....@@ -755,7 +759,7 @@
755759 #endif
756760 }
757761
758
-void ts_irq_disable(struct gsl_ts *ts)
762
+static void ts_irq_disable(struct gsl_ts *ts)
759763 {
760764 unsigned long irqflags;
761765
....@@ -767,7 +771,7 @@
767771 spin_unlock_irqrestore(&ts->irq_lock, irqflags);
768772 }
769773
770
-void ts_irq_enable(struct gsl_ts *ts)
774
+static void ts_irq_enable(struct gsl_ts *ts)
771775 {
772776 unsigned long irqflags = 0;
773777
....@@ -1227,7 +1231,8 @@
12271231 queue_delayed_work(gsl_monitor_workqueue, &gsl_monitor_work, 1000);
12281232 #endif
12291233 #ifdef TPD_PROC_DEBUG
1230
- proc_create(GSL_CONFIG_PROC_FILE, 0644, NULL, &gsl_seq_fops);
1234
+ proc_create(GSL_CONFIG_PROC_FILE, 0644, NULL,
1235
+ (const struct proc_ops *)&gsl_seq_fops);
12311236 gsl_proc_flag = 0;
12321237 #endif
12331238 ts->flag_activated = true;