Fix allocation of too big size
This commit is contained in:
parent
9815cc062f
commit
a254a7cd71
10
core/alloc.c
10
core/alloc.c
@ -205,10 +205,10 @@ static void *allocFromSlab(struct slabEntry *slab)
|
||||
|
||||
void *malloc(size_t size)
|
||||
{
|
||||
int flags;
|
||||
struct slabDesc *slab;
|
||||
struct slabDesc *slab = NULL;
|
||||
uint slubIdx;
|
||||
void *ret;
|
||||
int flags;
|
||||
|
||||
disable_IRQs(flags);
|
||||
|
||||
@ -217,6 +217,12 @@ void *malloc(size_t size)
|
||||
if (size <= slab->size)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!list_foreach_early_break(slub, slab, slubIdx)) {
|
||||
pr_devel("No slab found for %d\n", size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct slabEntry *slabEntry;
|
||||
int slabIdx;
|
||||
list_foreach(&slab->slab, slabEntry, slabIdx)
|
||||
|
Loading…
Reference in New Issue
Block a user