From 8558a54f15dcb407ca50af1a6c83830f387548fb Mon Sep 17 00:00:00 2001 From: Eliot Blennerhassett Date: Fri, 22 Jul 2011 15:52:46 +1200 Subject: [PATCH] --- yaml --- r: 257634 b: refs/heads/master c: 1c073b6797969dfc808d077cf28f9e0205070edd h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/sound/pci/asihpi/hpioctl.c | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 758a9f10d350..8867eac2612c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0a17e993076f226aca3463a1c7fb9265e06ed2d3 +refs/heads/master: 1c073b6797969dfc808d077cf28f9e0205070edd diff --git a/trunk/sound/pci/asihpi/hpioctl.c b/trunk/sound/pci/asihpi/hpioctl.c index d8e7047512f8..65fcf4770731 100644 --- a/trunk/sound/pci/asihpi/hpioctl.c +++ b/trunk/sound/pci/asihpi/hpioctl.c @@ -1,7 +1,7 @@ /******************************************************************************* AudioScience HPI driver - Copyright (C) 1997-2010 AudioScience Inc. + Copyright (C) 1997-2011 AudioScience Inc. This program is free software; you can redistribute it and/or modify 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) goto out; } - if (hm->h.adapter_index >= HPI_MAX_ADAPTERS) { - err = -EINVAL; - goto out; - } - switch (hm->h.function) { case HPI_SUBSYS_CREATE_ADAPTER: case HPI_ADAPTER_DELETE: @@ -187,7 +182,6 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) /* -1=no data 0=read from user mem, 1=write to user mem */ int wrflag = -1; u32 adapter = hm->h.adapter_index; - pa = &adapters[adapter]; if ((adapter > HPI_MAX_ADAPTERS) || (!pa->type)) { 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) goto out; } + pa = &adapters[adapter]; + if (mutex_lock_interruptible(&adapters[adapter].mutex)) { err = -EINTR; goto out;