All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>,
	Eliot Blennerhassett <eblennerhassett@audioscience.com>,
	alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org
Subject: [patch -next] sound/asihpi: incorrect range check
Date: Fri, 14 May 2010 16:50:05 +0200	[thread overview]
Message-ID: <20100514145005.GD17487@bicker> (raw)

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>

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

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>,
	Eliot Blennerhassett <eblennerhassett@audioscience.com>,
	alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org
Subject: [patch -next] sound/asihpi: incorrect range check
Date: Fri, 14 May 2010 14:50:05 +0000	[thread overview]
Message-ID: <20100514145005.GD17487@bicker> (raw)

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>

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

             reply	other threads:[~2010-05-14 14:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-14 14:50 Dan Carpenter [this message]
2010-05-14 14:50 ` [patch -next] sound/asihpi: incorrect range check Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100514145005.GD17487@bicker \
    --to=error27@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=eblennerhassett@audioscience.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.