aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2005-11-22 00:32:22 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-22 12:13:43 -0500
commitf3d48f0373c14a6203202f7b1dfc7b0d8aaf6ed2 (patch)
treee09198efae7c68b9b4799b0f85d67951cc33bb54 /arch
parent0b0db14c536debd92328819fe6c51a49717e8440 (diff)
[PATCH] unpaged: fix sound Bad page states
Earlier I unifdefed PageCompound, so that snd_pcm_mmap_control_nopage and others can give out a 0-order component of a higher-order page, which won't be mistakenly freed when zap_pte_range unmaps it. But many Bad page states reported a PG_reserved was freed after all: I had missed that we need to say __GFP_COMP to get compound page behaviour. Some of these higher-order pages are allocated by snd_malloc_pages, some by snd_malloc_dev_pages; or if SBUS, by sbus_alloc_consistent - but that has no gfp arg, so add __GFP_COMP into its sparc32/64 implementations. I'm still rather puzzled that DRM seems not to need a similar change. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/kernel/ioport.c2
-rw-r--r--arch/sparc64/kernel/sbus.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index d0f2bd227c4c..d39c9f206271 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -252,7 +252,7 @@ void *sbus_alloc_consistent(struct sbus_dev *sdev, long len, u32 *dma_addrp)
252 } 252 }
253 253
254 order = get_order(len_total); 254 order = get_order(len_total);
255 if ((va = __get_free_pages(GFP_KERNEL, order)) == 0) 255 if ((va = __get_free_pages(GFP_KERNEL|__GFP_COMP, order)) == 0)
256 goto err_nopages; 256 goto err_nopages;
257 257
258 if ((res = kmalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) 258 if ((res = kmalloc(sizeof(struct resource), GFP_KERNEL)) == NULL)
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
index 96b825055668..d95a1bcf163d 100644
--- a/arch/sparc64/kernel/sbus.c
+++ b/arch/sparc64/kernel/sbus.c
@@ -327,7 +327,7 @@ void *sbus_alloc_consistent(struct sbus_dev *sdev, size_t size, dma_addr_t *dvma
327 order = get_order(size); 327 order = get_order(size);
328 if (order >= 10) 328 if (order >= 10)
329 return NULL; 329 return NULL;
330 first_page = __get_free_pages(GFP_KERNEL, order); 330 first_page = __get_free_pages(GFP_KERNEL|__GFP_COMP, order);
331 if (first_page == 0UL) 331 if (first_page == 0UL)
332 return NULL; 332 return NULL;
333 memset((char *)first_page, 0, PAGE_SIZE << order); 333 memset((char *)first_page, 0, PAGE_SIZE << order);