Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262173
b: refs/heads/master
c: 08f984c
h: refs/heads/master
i:
  262171: 8804b34
v: v3
  • Loading branch information
Eliot Blennerhassett authored and Takashi Iwai committed Aug 2, 2011
1 parent 7f61eb3 commit 05bb240
Show file tree
Hide file tree
Showing 2 changed files with 13 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: dc889f18646325d07eb24ef634f082d60b0beebb
refs/heads/master: 08f984c7f7f569b66acbbd163676b4bc7f64addc
19 changes: 12 additions & 7 deletions trunk/sound/pci/asihpi/hpioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,21 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
} else {
u16 __user *ptr = NULL;
u32 size = 0;

u32 adapter_present;
/* -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];
struct hpi_adapter *pa;

if (hm->h.adapter_index < HPI_MAX_ADAPTERS) {
pa = &adapters[hm->h.adapter_index];
adapter_present = pa->type;
} else {
adapter_present = 0;
}

if ((adapter >= HPI_MAX_ADAPTERS) || (!pa->type)) {
hpi_init_response(&hr->r0, HPI_OBJ_ADAPTER,
HPI_ADAPTER_OPEN,
HPI_ERROR_BAD_ADAPTER_NUMBER);
if (!adapter_present) {
hpi_init_response(&hr->r0, hm->h.object,
hm->h.function, HPI_ERROR_BAD_ADAPTER_NUMBER);

uncopied_bytes =
copy_to_user(puhr, hr, sizeof(hr->h));
Expand Down

0 comments on commit 05bb240

Please sign in to comment.