Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F164777487
D17000.id47605.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
D17000.id47605.diff
View Options
Index: sys/compat/x86bios/x86bios.c
===================================================================
--- sys/compat/x86bios/x86bios.c
+++ sys/compat/x86bios/x86bios.c
@@ -655,18 +655,24 @@
static __inline void
x86bios_unmap_mem(void)
{
-
- free(x86bios_map, M_DEVBUF);
- if (x86bios_ivt != NULL)
+ if (x86bios_map != NULL) {
+ free(x86bios_map, M_DEVBUF);
+ x86bios_map = NULL;
+ }
+ if (x86bios_ivt != NULL) {
#ifdef X86BIOS_NATIVE_ARCH
pmap_unmapbios((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE);
#else
free(x86bios_ivt, M_DEVBUF);
+ x86bios_ivt = NULL;
#endif
+ }
if (x86bios_rom != NULL)
pmap_unmapdev((vm_offset_t)x86bios_rom, X86BIOS_ROM_SIZE);
- if (x86bios_seg != NULL)
+ if (x86bios_seg != NULL) {
contigfree(x86bios_seg, X86BIOS_SEG_SIZE, M_DEVBUF);
+ x86bios_seg = NULL;
+ }
}
static __inline int
@@ -674,7 +680,9 @@
{
x86bios_map = malloc(sizeof(*x86bios_map) * X86BIOS_PAGES, M_DEVBUF,
- M_WAITOK | M_ZERO);
+ M_NOWAIT | M_ZERO);
+ if (x86bios_map == NULL)
+ goto fail;
#ifdef X86BIOS_NATIVE_ARCH
x86bios_ivt = pmap_mapbios(X86BIOS_IVT_BASE, X86BIOS_IVT_SIZE);
@@ -688,7 +696,9 @@
rounddown(x86bios_rom_phys, X86BIOS_PAGE_SIZE);
else
#else
- x86bios_ivt = malloc(X86BIOS_IVT_SIZE, M_DEVBUF, M_ZERO | M_WAITOK);
+ x86bios_ivt = malloc(X86BIOS_IVT_SIZE, M_DEVBUF, M_ZERO | M_NOWAIT);
+ if (x86bios_ivt == NULL)
+ goto fail;
#endif
x86bios_rom_phys = X86BIOS_ROM_BASE;
@@ -703,8 +713,10 @@
goto fail;
#endif
- x86bios_seg = contigmalloc(X86BIOS_SEG_SIZE, M_DEVBUF, M_WAITOK,
+ x86bios_seg = contigmalloc(X86BIOS_SEG_SIZE, M_DEVBUF, M_NOWAIT,
X86BIOS_RAM_BASE, x86bios_rom_phys, X86BIOS_PAGE_SIZE, 0);
+ if (x86bios_seg == NULL)
+ goto fail;
x86bios_seg_phys = vtophys(x86bios_seg);
x86bios_set_pages((vm_offset_t)x86bios_ivt, X86BIOS_IVT_BASE,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Aug 4, 11:07 PM (18 m, 22 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35974790
Default Alt Text
D17000.id47605.diff (1 KB)
Attached To
Mode
D17000: x86bios: use M_NOWAIT with mallocs
Attached
Detach File
Event Timeline
Log In to Comment