Loading drivers/char/diag/diag_dci.c +5 −3 Original line number Diff line number Diff line Loading @@ -1056,9 +1056,7 @@ void extract_dci_pkt_rsp(unsigned char *buf, int len, int data_source, */ if ((rsp_buf->data_len + 9 + rsp_len) > rsp_buf->capacity) { pr_alert("diag: create capacity for pkt rsp\n"); rsp_buf->capacity += 9 + rsp_len; temp_buf = krealloc(rsp_buf->data, rsp_buf->capacity, GFP_KERNEL); temp_buf = vzalloc(rsp_buf->capacity + 9 + rsp_len); if (!temp_buf) { pr_err("diag: DCI realloc failed\n"); mutex_unlock(&rsp_buf->data_mutex); Loading @@ -1066,6 +1064,10 @@ void extract_dci_pkt_rsp(unsigned char *buf, int len, int data_source, mutex_unlock(&driver->dci_mutex); return; } rsp_buf->capacity += 9 + rsp_len; if (rsp_buf->capacity > rsp_buf->data_len) memcpy(temp_buf, rsp_buf->data, rsp_buf->data_len); vfree(rsp_buf->data); rsp_buf->data = temp_buf; } Loading Loading
drivers/char/diag/diag_dci.c +5 −3 Original line number Diff line number Diff line Loading @@ -1056,9 +1056,7 @@ void extract_dci_pkt_rsp(unsigned char *buf, int len, int data_source, */ if ((rsp_buf->data_len + 9 + rsp_len) > rsp_buf->capacity) { pr_alert("diag: create capacity for pkt rsp\n"); rsp_buf->capacity += 9 + rsp_len; temp_buf = krealloc(rsp_buf->data, rsp_buf->capacity, GFP_KERNEL); temp_buf = vzalloc(rsp_buf->capacity + 9 + rsp_len); if (!temp_buf) { pr_err("diag: DCI realloc failed\n"); mutex_unlock(&rsp_buf->data_mutex); Loading @@ -1066,6 +1064,10 @@ void extract_dci_pkt_rsp(unsigned char *buf, int len, int data_source, mutex_unlock(&driver->dci_mutex); return; } rsp_buf->capacity += 9 + rsp_len; if (rsp_buf->capacity > rsp_buf->data_len) memcpy(temp_buf, rsp_buf->data, rsp_buf->data_len); vfree(rsp_buf->data); rsp_buf->data = temp_buf; } Loading