Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115359
b: refs/heads/master
c: 428ffb7
h: refs/heads/master
i:
  115357: 4a6488a
  115355: 6dc4b90
  115351: b883dcb
  115343: c7a6c8f
  115327: 110aaa7
v: v3
  • Loading branch information
Li Zefan authored and Takashi Iwai committed Oct 15, 2008
1 parent c45f2aa commit b4f639e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 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: 8825e8e8d09c1fe6352f94c70f6ff73db449ff56
refs/heads/master: 428ffb7151a4078994b5c01ecbf845954843c1ec
13 changes: 7 additions & 6 deletions trunk/sound/usb/usx2y/us122l.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,19 @@ static int usb_stream_hwdep_vm_fault(struct vm_area_struct *area,
void *vaddr;
struct us122l *us122l = area->vm_private_data;
struct usb_stream *s;
int vm_f = VM_FAULT_SIGBUS;

mutex_lock(&us122l->mutex);
s = us122l->sk.s;
if (!s)
goto out;
goto unlock;

offset = vmf->pgoff << PAGE_SHIFT;
if (offset < PAGE_ALIGN(s->read_size))
vaddr = (char *)s + offset;
else {
offset -= PAGE_ALIGN(s->read_size);
if (offset >= PAGE_ALIGN(s->write_size))
goto out;
goto unlock;

vaddr = us122l->sk.write_page + offset;
}
Expand All @@ -141,9 +140,11 @@ static int usb_stream_hwdep_vm_fault(struct vm_area_struct *area,
mutex_unlock(&us122l->mutex);

vmf->page = page;
vm_f = 0;
out:
return vm_f;

return 0;
unlock:
mutex_unlock(&us122l->mutex);
return VM_FAULT_SIGBUS;
}

static void usb_stream_hwdep_vm_close(struct vm_area_struct *area)
Expand Down

0 comments on commit b4f639e

Please sign in to comment.