input: ilitek_0flash_mmi: change memcpy wlen value

ilitek_0flash_mmi:
Change memcpy wlen value, to avoid memory access issue
for KASAN check.
NO_PROP_NEEDED: <New IC for NPI>

Change-Id: I847ec5f6c8c57fafed4e9b9119c77162ee39e682
Signed-off-by: wangyq13 <wangyq13@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1756549
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wei Deng <dengwei1@motorola.com>
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
wangyq13 2020-09-22 17:08:10 +08:00 • committed by Yeqing Wang
commit 707ee16fb1

View file

@ -252,9 +252,9 @@ static int ili_spi_pll_clk_wakeup(void)
wdata[1] = wlen >> 8;
wdata[2] = wlen & 0xff;
index = 3;
wlen += index;
ipio_memcpy(&wdata[index], wakeup, wlen, wlen);
wlen += index;
ILI_INFO("Write dummy to wake up spi pll clk\n");
if (ilits->spi_write_then_read(ilits->spi, wdata, wlen, NULL, 0) < 0) {
@ -282,7 +282,7 @@ static int ili_spi_wrapper(u8 *txbuf, u32 wlen, u8 *rxbuf, u32 rlen, bool spi_ir
/* 3 bytes data consist of length and header */
if ((wlen + 3) > sizeof(wdata)) {
ILI_ERR("WARNING! wlen(%d) > wdata(%d), using wdata length to transfer\n", wlen, (int)sizeof(wdata));
wlen = sizeof(wdata);
wlen = sizeof(wdata) - 3;
}
}
@ -330,9 +330,8 @@ static int ili_spi_wrapper(u8 *txbuf, u32 wlen, u8 *rxbuf, u32 rlen, bool spi_ir
index = 3;
}
wlen += index;
ipio_memcpy(&wdata[index], txbuf, wlen, wlen);
wlen += index;
/*
* NOTE: If TP driver is doing MP test and commanding 0xF1 to FW, we add a checksum