Loading drivers/char/diag/diag_masks.c +11 −2 Original line number Diff line number Diff line Loading @@ -195,10 +195,11 @@ static void diag_send_log_mask_update(uint8_t peripheral, int equip_id) } mask_info->update_buf = temp; mask_info->update_buf_len = header_len + mask_size; buf = temp; } memcpy(buf, &ctrl_pkt, header_len); if (mask_size > 0) if (mask_size > 0 && mask_size <= LOG_MASK_SIZE) memcpy(buf + header_len, mask->ptr, mask_size); mutex_unlock(&mask->lock); Loading Loading @@ -297,9 +298,16 @@ static void diag_send_event_mask_update(uint8_t peripheral) } else { mask_info->update_buf = temp; mask_info->update_buf_len = temp_len; buf = temp; } } if (num_bytes > 0 && num_bytes < mask_info->mask_len) memcpy(buf + sizeof(header), mask_info->ptr, num_bytes); else { pr_err("diag: num_bytes(%d) is not satisfying length condition\n", num_bytes); goto err; } write_len += num_bytes; break; default: Loading Loading @@ -415,6 +423,7 @@ static void diag_send_msg_mask_update(uint8_t peripheral, int first, int last) } else { mask_info->update_buf = temp; mask_info->update_buf_len = temp_len; buf = temp; pr_debug("diag: In %s, successfully reallocated msg_mask update buffer to len: %d\n", __func__, mask_info->update_buf_len); } Loading Loading
drivers/char/diag/diag_masks.c +11 −2 Original line number Diff line number Diff line Loading @@ -195,10 +195,11 @@ static void diag_send_log_mask_update(uint8_t peripheral, int equip_id) } mask_info->update_buf = temp; mask_info->update_buf_len = header_len + mask_size; buf = temp; } memcpy(buf, &ctrl_pkt, header_len); if (mask_size > 0) if (mask_size > 0 && mask_size <= LOG_MASK_SIZE) memcpy(buf + header_len, mask->ptr, mask_size); mutex_unlock(&mask->lock); Loading Loading @@ -297,9 +298,16 @@ static void diag_send_event_mask_update(uint8_t peripheral) } else { mask_info->update_buf = temp; mask_info->update_buf_len = temp_len; buf = temp; } } if (num_bytes > 0 && num_bytes < mask_info->mask_len) memcpy(buf + sizeof(header), mask_info->ptr, num_bytes); else { pr_err("diag: num_bytes(%d) is not satisfying length condition\n", num_bytes); goto err; } write_len += num_bytes; break; default: Loading Loading @@ -415,6 +423,7 @@ static void diag_send_msg_mask_update(uint8_t peripheral, int first, int last) } else { mask_info->update_buf = temp; mask_info->update_buf_len = temp_len; buf = temp; pr_debug("diag: In %s, successfully reallocated msg_mask update buffer to len: %d\n", __func__, mask_info->update_buf_len); } Loading