From 8575c3bf131c42841b66aae7acf96b7310524f56 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 17 Apr 2024 23:47:46 -0400 Subject: kernel: vm_map: Handle pager errors Signed-off-by: Ian Moffett --- sys/vm/vm_map.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/vm') diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 19320cd..e8dc0ed 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -213,7 +213,10 @@ vm_fd_map(void *addr, vm_prot_t prot, size_t len, off_t off, int fd) } pg.physaddr = physmem; - vm_pager_get(vp->vmobj, off, len, &pg); + + if (vm_pager_get(vp->vmobj, off, len, &pg) != 0) + return 0; + return physmem; } -- cgit v1.2.3