ALSA: asihpi: incorrect range check
authorDan Carpenter <error27@gmail.com>
Fri, 14 May 2010 14:50:05 +0000 (16:50 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 17 May 2010 06:10:34 +0000 (08:10 +0200)
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>
sound/pci/asihpi/hpifunc.c

index 15f0c7e..eda26b3 100644 (file)
@@ -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;