Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137850638
D14955.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14955.diff
View Options
Index: head/sys/powerpc/ofw/ofw_real.c
===================================================================
--- head/sys/powerpc/ofw/ofw_real.c
+++ head/sys/powerpc/ofw/ofw_real.c
@@ -197,6 +197,8 @@
static void
ofw_real_bounce_alloc(void *junk)
{
+ caddr_t temp;
+
/*
* Check that ofw_real is actually in use before allocating wads
* of memory. Do this by checking if our mutex has been set up.
@@ -208,12 +210,15 @@
* Allocate a page of contiguous, wired physical memory that can
* fit into a 32-bit address space and accessed from real mode.
*/
+ temp = contigmalloc(4 * PAGE_SIZE, M_OFWREAL, 0, 0,
+ ulmin(platform_real_maxaddr(), BUS_SPACE_MAXADDR_32BIT), PAGE_SIZE,
+ 4 * PAGE_SIZE);
+ if (temp == NULL)
+ panic("%s: Not able to allocated contiguous memory\n", __func__);
mtx_lock(&of_bounce_mtx);
- of_bounce_virt = contigmalloc(4 * PAGE_SIZE, M_OFWREAL, 0, 0,
- ulmin(platform_real_maxaddr(), BUS_SPACE_MAXADDR_32BIT), PAGE_SIZE,
- 4 * PAGE_SIZE);
+ of_bounce_virt = temp;
of_bounce_phys = vtophys(of_bounce_virt);
of_bounce_size = 4 * PAGE_SIZE;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 27, 10:34 AM (6 m, 4 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26231785
Default Alt Text
D14955.diff (1 KB)
Attached To
Mode
D14955: powerpc/ofw: Fix malloc inside lock
Attached
Detach File
Event Timeline
Log In to Comment