nova_0flash_mmi: increase the size of fwbuf

Increase the size of fwbuf, there are some dummy bytes when do
spi read and write, cause kasan errors.

Change-Id: Ifab4c686c4b056ed2327c6b43c446f49be94b27a
Signed-off-by: wangyq13 <wangyq13@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1449952
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
wangyq13 2019-11-06 15:22:13 +08:00 • committed by Yeqing Wang
commit 2188d41c89
3 changed files with 7 additions and 7 deletions

View file

@ -361,7 +361,7 @@ return:
*******************************************************/
void nvt_bld_crc_enable(void)
{
uint8_t buf[2] = {0};
uint8_t buf[4] = {0};
//---set xdata index to BLD_CRC_EN_ADDR---
nvt_set_page(ts->mmap->BLD_CRC_EN_ADDR);
@ -386,7 +386,7 @@ return:
*******************************************************/
void nvt_fw_crc_enable(void)
{
uint8_t buf[2] = {0};
uint8_t buf[4] = {0};
//---set xdata index to EVENT BUF ADDR---
nvt_set_page(ts->mmap->EVENT_BUF_ADDR);
@ -622,7 +622,7 @@ return:
*******************************************************/
int32_t nvt_read_pid(void)
{
uint8_t buf[3] = {0};
uint8_t buf[4] = {0};
int32_t ret = 0;
//---set xdata index to EVENT BUF ADDR---
@ -1772,7 +1772,7 @@ static int32_t nvt_ts_probe(struct spi_device *client)
return -ENOMEM;
}
ts->xbuf = (uint8_t *)kzalloc((NVT_TRANSFER_LEN+1), GFP_KERNEL);
ts->xbuf = (uint8_t *)kzalloc((NVT_TRANSFER_LEN+2), GFP_KERNEL);
if(ts->xbuf == NULL) {
NVT_ERR("kzalloc for xbuf failed!\n");
if (ts) {

View file

@ -110,7 +110,7 @@ void nvt_read_mdata(uint32_t xdata_addr, uint32_t xdata_btn_addr)
int32_t i = 0;
int32_t j = 0;
int32_t k = 0;
uint8_t buf[BUS_TRANSFER_LENGTH + 1] = {0};
uint8_t buf[BUS_TRANSFER_LENGTH + 2] = {0};
uint32_t head_addr = 0;
int32_t dummy_len = 0;
int32_t data_len = 0;

View file

@ -92,7 +92,7 @@ static int32_t nvt_download_init(void)
//NVT_LOG("NVT_TRANSFER_LEN = 0x%06X\n", NVT_TRANSFER_LEN);
if (fwbuf == NULL) {
fwbuf = (uint8_t *)kzalloc((NVT_TRANSFER_LEN+1), GFP_KERNEL);
fwbuf = (uint8_t *)kzalloc((NVT_TRANSFER_LEN+2), GFP_KERNEL);
if(fwbuf == NULL) {
NVT_ERR("kzalloc for fwbuf failed!\n");
return -ENOMEM;
@ -567,7 +567,7 @@ static int32_t nvt_write_firmware(const u8 *fwdata, size_t fwsize)
uint32_t BIN_addr, SRAM_addr, size;
int32_t ret = 0;
memset(fwbuf, 0, (NVT_TRANSFER_LEN+1));
memset(fwbuf, 0, (NVT_TRANSFER_LEN+2));
for (list = 0; list < partition; list++) {
/* initialize variable */