mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
Eliminate unnecessary gotos from kmem_malloc().
This commit is contained in:
parent
a5f099d0c4
commit
f31c239da1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113418
@ -333,12 +333,12 @@ kmem_malloc(map, size, flags)
|
||||
printf("Out of mbuf address space!\n");
|
||||
printf("Consider increasing NMBCLUSTERS\n");
|
||||
}
|
||||
goto bad;
|
||||
return (0);
|
||||
}
|
||||
if ((flags & M_NOWAIT) == 0)
|
||||
panic("kmem_malloc(%ld): kmem_map too small: %ld total allocated",
|
||||
(long)size, (long)map->size);
|
||||
goto bad;
|
||||
return (0);
|
||||
}
|
||||
offset = addr - VM_MIN_KERNEL_ADDRESS;
|
||||
vm_object_reference(kmem_object);
|
||||
@ -399,7 +399,7 @@ kmem_malloc(map, size, flags)
|
||||
vm_object_unlock(kmem_object);
|
||||
vm_map_delete(map, addr, addr + size);
|
||||
vm_map_unlock(map);
|
||||
goto bad;
|
||||
return (0);
|
||||
}
|
||||
if (flags & M_ZERO && (m->flags & PG_ZERO) == 0)
|
||||
pmap_zero_page(m);
|
||||
@ -445,9 +445,6 @@ kmem_malloc(map, size, flags)
|
||||
vm_map_unlock(map);
|
||||
|
||||
return (addr);
|
||||
|
||||
bad:
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user