Skip to content

Commit 3eb87d4

Browse files
Souptick Joardergregkh
authored andcommitted
char: mspec: change return type to vm_fault_t
Use new return type vm_fault_t for the fault handler in struct vm_operations_struct. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. This driver failed to handle any error returned by vm_insert_pfn. Use the new vmf_insert_pfn function to return the correct value. Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 851b4c1 commit 3eb87d4

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

‎drivers/char/mspec.c‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ mspec_close(struct vm_area_struct *vma)
191191
*
192192
* Creates a mspec page and maps it to user space.
193193
*/
194-
static int
194+
static vm_fault_t
195195
mspec_fault(struct vm_fault *vmf)
196196
{
197197
unsigned long paddr, maddr;
@@ -223,14 +223,7 @@ mspec_fault(struct vm_fault *vmf)
223223

224224
pfn = paddr >> PAGE_SHIFT;
225225

226-
/*
227-
* vm_insert_pfn can fail with -EBUSY, but in that case it will
228-
* be because another thread has installed the pte first, so it
229-
* is no problem.
230-
*/
231-
vm_insert_pfn(vmf->vma, vmf->address, pfn);
232-
233-
return VM_FAULT_NOPAGE;
226+
return vmf_insert_pfn(vmf->vma, vmf->address, pfn);
234227
}
235228

236229
static const struct vm_operations_struct mspec_vm_ops = {

0 commit comments

Comments
 (0)