diff options
author | Eliot Blennerhassett <eblennerhassett@audioscience.com> | 2011-07-21 23:52:46 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-07-22 01:50:44 -0400 |
commit | 1c073b6797969dfc808d077cf28f9e0205070edd (patch) | |
tree | a66ce1394433bb5b91a93fa1d08951b7d6f21297 /sound/pci/asihpi | |
parent | 0a17e993076f226aca3463a1c7fb9265e06ed2d3 (diff) |
ALSA: asihpi - Remove spurious adapter index check
Subsystem requests don't have or need a valid adapter index.
The adapter index is already checked further on, before it is used to index
the adapters array. (Reverts 4a122c10f)
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/asihpi')
-rw-r--r-- | sound/pci/asihpi/hpioctl.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c index d8e7047512f8..65fcf4770731 100644 --- a/sound/pci/asihpi/hpioctl.c +++ b/sound/pci/asihpi/hpioctl.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | AudioScience HPI driver | 3 | AudioScience HPI driver |
4 | Copyright (C) 1997-2010 AudioScience Inc. <support@audioscience.com> | 4 | Copyright (C) 1997-2011 AudioScience Inc. <support@audioscience.com> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of version 2 of the GNU General Public License as | 7 | it under the terms of version 2 of the GNU General Public License as |
@@ -157,11 +157,6 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
157 | goto out; | 157 | goto out; |
158 | } | 158 | } |
159 | 159 | ||
160 | if (hm->h.adapter_index >= HPI_MAX_ADAPTERS) { | ||
161 | err = -EINVAL; | ||
162 | goto out; | ||
163 | } | ||
164 | |||
165 | switch (hm->h.function) { | 160 | switch (hm->h.function) { |
166 | case HPI_SUBSYS_CREATE_ADAPTER: | 161 | case HPI_SUBSYS_CREATE_ADAPTER: |
167 | case HPI_ADAPTER_DELETE: | 162 | case HPI_ADAPTER_DELETE: |
@@ -187,7 +182,6 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
187 | /* -1=no data 0=read from user mem, 1=write to user mem */ | 182 | /* -1=no data 0=read from user mem, 1=write to user mem */ |
188 | int wrflag = -1; | 183 | int wrflag = -1; |
189 | u32 adapter = hm->h.adapter_index; | 184 | u32 adapter = hm->h.adapter_index; |
190 | pa = &adapters[adapter]; | ||
191 | 185 | ||
192 | if ((adapter > HPI_MAX_ADAPTERS) || (!pa->type)) { | 186 | if ((adapter > HPI_MAX_ADAPTERS) || (!pa->type)) { |
193 | hpi_init_response(&hr->r0, HPI_OBJ_ADAPTER, | 187 | hpi_init_response(&hr->r0, HPI_OBJ_ADAPTER, |
@@ -203,6 +197,8 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
203 | goto out; | 197 | goto out; |
204 | } | 198 | } |
205 | 199 | ||
200 | pa = &adapters[adapter]; | ||
201 | |||
206 | if (mutex_lock_interruptible(&adapters[adapter].mutex)) { | 202 | if (mutex_lock_interruptible(&adapters[adapter].mutex)) { |
207 | err = -EINTR; | 203 | err = -EINTR; |
208 | goto out; | 204 | goto out; |