diff options
Diffstat (limited to 'sound/usb/usx2y/us122l.c')
-rw-r--r-- | sound/usb/usx2y/us122l.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index b441fe2cd190..c2515b680f9f 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c | |||
@@ -118,12 +118,11 @@ static int usb_stream_hwdep_vm_fault(struct vm_area_struct *area, | |||
118 | void *vaddr; | 118 | void *vaddr; |
119 | struct us122l *us122l = area->vm_private_data; | 119 | struct us122l *us122l = area->vm_private_data; |
120 | struct usb_stream *s; | 120 | struct usb_stream *s; |
121 | int vm_f = VM_FAULT_SIGBUS; | ||
122 | 121 | ||
123 | mutex_lock(&us122l->mutex); | 122 | mutex_lock(&us122l->mutex); |
124 | s = us122l->sk.s; | 123 | s = us122l->sk.s; |
125 | if (!s) | 124 | if (!s) |
126 | goto out; | 125 | goto unlock; |
127 | 126 | ||
128 | offset = vmf->pgoff << PAGE_SHIFT; | 127 | offset = vmf->pgoff << PAGE_SHIFT; |
129 | if (offset < PAGE_ALIGN(s->read_size)) | 128 | if (offset < PAGE_ALIGN(s->read_size)) |
@@ -131,7 +130,7 @@ static int usb_stream_hwdep_vm_fault(struct vm_area_struct *area, | |||
131 | else { | 130 | else { |
132 | offset -= PAGE_ALIGN(s->read_size); | 131 | offset -= PAGE_ALIGN(s->read_size); |
133 | if (offset >= PAGE_ALIGN(s->write_size)) | 132 | if (offset >= PAGE_ALIGN(s->write_size)) |
134 | goto out; | 133 | goto unlock; |
135 | 134 | ||
136 | vaddr = us122l->sk.write_page + offset; | 135 | vaddr = us122l->sk.write_page + offset; |
137 | } | 136 | } |
@@ -141,9 +140,11 @@ static int usb_stream_hwdep_vm_fault(struct vm_area_struct *area, | |||
141 | mutex_unlock(&us122l->mutex); | 140 | mutex_unlock(&us122l->mutex); |
142 | 141 | ||
143 | vmf->page = page; | 142 | vmf->page = page; |
144 | vm_f = 0; | 143 | |
145 | out: | 144 | return 0; |
146 | return vm_f; | 145 | unlock: |
146 | mutex_unlock(&us122l->mutex); | ||
147 | return VM_FAULT_SIGBUS; | ||
147 | } | 148 | } |
148 | 149 | ||
149 | static void usb_stream_hwdep_vm_close(struct vm_area_struct *area) | 150 | static void usb_stream_hwdep_vm_close(struct vm_area_struct *area) |