Commit 1be1d76b authored by Dan Carpenter's avatar Dan Carpenter Committed by Takashi Iwai

ALSA: asihpi: incorrect range check

The entity_type_to_size[] array has LAST_ENTITY_TYPE (11) number of elements,
not LAST_ENTITY_ROLE (17).  This only affects the debug output.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 2448b147
...@@ -3407,7 +3407,7 @@ u16 hpi_entity_alloc_and_pack(const enum e_entity_type type, ...@@ -3407,7 +3407,7 @@ u16 hpi_entity_alloc_and_pack(const enum e_entity_type type,
if (hE) if (hE)
return hE; return hE;
HPI_DEBUG_ASSERT(role > entity_role_null && type < LAST_ENTITY_ROLE); HPI_DEBUG_ASSERT(role > entity_role_null && type < LAST_ENTITY_TYPE);
bytes_to_copy = entity_type_to_size[type] * item_count; bytes_to_copy = entity_type_to_size[type] * item_count;
total_size = hpi_entity_header_size(*entity) + bytes_to_copy; total_size = hpi_entity_header_size(*entity) + bytes_to_copy;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment