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 /sound/core | |
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 'sound/core')
-rw-r--r-- | sound/core/pcm_native.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 66e24b5da469..6ea67b16c676 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -3027,7 +3027,7 @@ static struct page * snd_pcm_mmap_status_nopage(struct vm_area_struct *area, | |||
3027 | struct page * page; | 3027 | struct page * page; |
3028 | 3028 | ||
3029 | if (substream == NULL) | 3029 | if (substream == NULL) |
3030 | return NOPAGE_OOM; | 3030 | return NOPAGE_SIGBUS; |
3031 | runtime = substream->runtime; | 3031 | runtime = substream->runtime; |
3032 | page = virt_to_page(runtime->status); | 3032 | page = virt_to_page(runtime->status); |
3033 | get_page(page); | 3033 | get_page(page); |
@@ -3070,7 +3070,7 @@ static struct page * snd_pcm_mmap_control_nopage(struct vm_area_struct *area, | |||
3070 | struct page * page; | 3070 | struct page * page; |
3071 | 3071 | ||
3072 | if (substream == NULL) | 3072 | if (substream == NULL) |
3073 | return NOPAGE_OOM; | 3073 | return NOPAGE_SIGBUS; |
3074 | runtime = substream->runtime; | 3074 | runtime = substream->runtime; |
3075 | page = virt_to_page(runtime->control); | 3075 | page = virt_to_page(runtime->control); |
3076 | get_page(page); | 3076 | get_page(page); |
@@ -3131,18 +3131,18 @@ static struct page *snd_pcm_mmap_data_nopage(struct vm_area_struct *area, | |||
3131 | size_t dma_bytes; | 3131 | size_t dma_bytes; |
3132 | 3132 | ||
3133 | if (substream == NULL) | 3133 | if (substream == NULL) |
3134 | return NOPAGE_OOM; | 3134 | return NOPAGE_SIGBUS; |
3135 | runtime = substream->runtime; | 3135 | runtime = substream->runtime; |
3136 | offset = area->vm_pgoff << PAGE_SHIFT; | 3136 | offset = area->vm_pgoff << PAGE_SHIFT; |
3137 | offset += address - area->vm_start; | 3137 | offset += address - area->vm_start; |
3138 | snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); | 3138 | snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_SIGBUS); |
3139 | dma_bytes = PAGE_ALIGN(runtime->dma_bytes); | 3139 | dma_bytes = PAGE_ALIGN(runtime->dma_bytes); |
3140 | if (offset > dma_bytes - PAGE_SIZE) | 3140 | if (offset > dma_bytes - PAGE_SIZE) |
3141 | return NOPAGE_SIGBUS; | 3141 | return NOPAGE_SIGBUS; |
3142 | if (substream->ops->page) { | 3142 | if (substream->ops->page) { |
3143 | page = substream->ops->page(substream, offset); | 3143 | page = substream->ops->page(substream, offset); |
3144 | if (! page) | 3144 | if (! page) |
3145 | return NOPAGE_OOM; | 3145 | return NOPAGE_OOM; /* XXX: is this really due to OOM? */ |
3146 | } else { | 3146 | } else { |
3147 | vaddr = runtime->dma_area + offset; | 3147 | vaddr = runtime->dma_area + offset; |
3148 | page = virt_to_page(vaddr); | 3148 | page = virt_to_page(vaddr); |