Skip to content

Commit

Permalink
ALSA: asihpi: incorrect range check
Browse files Browse the repository at this point in the history
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: Dan Carpenter <error27@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Dan Carpenter authored and Takashi Iwai committed May 17, 2010
1 parent 2448b14 commit 1be1d76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/pci/asihpi/hpifunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3407,7 +3407,7 @@ u16 hpi_entity_alloc_and_pack(const enum e_entity_type type,
if (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;
total_size = hpi_entity_header_size(*entity) + bytes_to_copy;
Expand Down

0 comments on commit 1be1d76

Please sign in to comment.