diff options
author | Nick Piggin <npiggin@suse.de> | 2006-12-06 23:31:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:20 -0500 |
commit | cd54e7e54318d333227b13186f9a464bf1f68d27 (patch) | |
tree | 75bf795ab6c3805f318b2d3040321ba31ef35c6a /drivers/char/drm/drm_vm.c | |
parent | f2a2a7108aa0039ba7a5fe7a0d2ecef2219a7584 (diff) |
[PATCH] mm: incorrect VM_FAULT_OOM returns from drivers
Some drivers are returning OOM when it is not in response to a memory
shortage.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Dave Airlie <airlied@linux.ie>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/drm/drm_vm.c')
-rw-r--r-- | drivers/char/drm/drm_vm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c index b40ae438f53..ae2691942dd 100644 --- a/drivers/char/drm/drm_vm.c +++ b/drivers/char/drm/drm_vm.c | |||
@@ -147,14 +147,14 @@ static __inline__ struct page *drm_do_vm_shm_nopage(struct vm_area_struct *vma, | |||
147 | if (address > vma->vm_end) | 147 | if (address > vma->vm_end) |
148 | return NOPAGE_SIGBUS; /* Disallow mremap */ | 148 | return NOPAGE_SIGBUS; /* Disallow mremap */ |
149 | if (!map) | 149 | if (!map) |
150 | return NOPAGE_OOM; /* Nothing allocated */ | 150 | return NOPAGE_SIGBUS; /* Nothing allocated */ |
151 | 151 | ||
152 | offset = address - vma->vm_start; | 152 | offset = address - vma->vm_start; |
153 | i = (unsigned long)map->handle + offset; | 153 | i = (unsigned long)map->handle + offset; |
154 | page = (map->type == _DRM_CONSISTENT) ? | 154 | page = (map->type == _DRM_CONSISTENT) ? |
155 | virt_to_page((void *)i) : vmalloc_to_page((void *)i); | 155 | virt_to_page((void *)i) : vmalloc_to_page((void *)i); |
156 | if (!page) | 156 | if (!page) |
157 | return NOPAGE_OOM; | 157 | return NOPAGE_SIGBUS; |
158 | get_page(page); | 158 | get_page(page); |
159 | 159 | ||
160 | DRM_DEBUG("shm_nopage 0x%lx\n", address); | 160 | DRM_DEBUG("shm_nopage 0x%lx\n", address); |
@@ -272,7 +272,7 @@ static __inline__ struct page *drm_do_vm_dma_nopage(struct vm_area_struct *vma, | |||
272 | if (address > vma->vm_end) | 272 | if (address > vma->vm_end) |
273 | return NOPAGE_SIGBUS; /* Disallow mremap */ | 273 | return NOPAGE_SIGBUS; /* Disallow mremap */ |
274 | if (!dma->pagelist) | 274 | if (!dma->pagelist) |
275 | return NOPAGE_OOM; /* Nothing allocated */ | 275 | return NOPAGE_SIGBUS; /* Nothing allocated */ |
276 | 276 | ||
277 | offset = address - vma->vm_start; /* vm_[pg]off[set] should be 0 */ | 277 | offset = address - vma->vm_start; /* vm_[pg]off[set] should be 0 */ |
278 | page_nr = offset >> PAGE_SHIFT; | 278 | page_nr = offset >> PAGE_SHIFT; |
@@ -310,7 +310,7 @@ static __inline__ struct page *drm_do_vm_sg_nopage(struct vm_area_struct *vma, | |||
310 | if (address > vma->vm_end) | 310 | if (address > vma->vm_end) |
311 | return NOPAGE_SIGBUS; /* Disallow mremap */ | 311 | return NOPAGE_SIGBUS; /* Disallow mremap */ |
312 | if (!entry->pagelist) | 312 | if (!entry->pagelist) |
313 | return NOPAGE_OOM; /* Nothing allocated */ | 313 | return NOPAGE_SIGBUS; /* Nothing allocated */ |
314 | 314 | ||
315 | offset = address - vma->vm_start; | 315 | offset = address - vma->vm_start; |
316 | map_offset = map->offset - (unsigned long)dev->sg->virtual; | 316 | map_offset = map->offset - (unsigned long)dev->sg->virtual; |