Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260962
b: refs/heads/master
c: 767cd36
h: refs/heads/master
v: v3
  • Loading branch information
Eliot Blennerhassett authored and Takashi Iwai committed Jul 27, 2011
1 parent 76ee072 commit c731371
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 45eebda7b4a73deb268b0cbcde06b603a2ba46a2
refs/heads/master: 767cd365b22820df07b962b49ce04b220b98e537
11 changes: 4 additions & 7 deletions trunk/sound/pci/asihpi/hpioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
union hpi_response_buffer_v1 *hr;
u16 res_max_size;
u32 uncopied_bytes;
struct hpi_adapter *pa = NULL;
int err = 0;

if (cmd != HPI_IOCTL_LINUX)
Expand Down Expand Up @@ -182,6 +181,7 @@ 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;
struct hpi_adapter *pa = &adapters[adapter];

if ((adapter > HPI_MAX_ADAPTERS) || (!pa->type)) {
hpi_init_response(&hr->r0, HPI_OBJ_ADAPTER,
Expand All @@ -197,9 +197,7 @@ 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)) {
if (mutex_lock_interruptible(&pa->mutex)) {
err = -EINTR;
goto out;
}
Expand Down Expand Up @@ -235,8 +233,7 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
"stream buffer size %d\n",
size);

mutex_unlock(&adapters
[adapter].mutex);
mutex_unlock(&pa->mutex);
err = -EINVAL;
goto out;
}
Expand Down Expand Up @@ -277,7 +274,7 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
uncopied_bytes, size);
}

mutex_unlock(&adapters[adapter].mutex);
mutex_unlock(&pa->mutex);
}

/* on return response size must be set */
Expand Down

0 comments on commit c731371

Please sign in to comment.