Skip to contentSkip to conversation

sound/asihpi: incorrect range check

PATCH New Dan Carpenter 1 participant 1 message May 14, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound/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.

sound/pci/asihpi/hpifunc.c +1 -1
index 254c580..eda26b3 100644
@@ -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;