Message ID | 20170223032155.10589-1-stewart@linux.vnet.ibm.com |
---|---|
State | Accepted |
Headers | show |
Stewart Smith <stewart@linux.vnet.ibm.com> writes: > All callers of buddy_create() are correctly checking return value. > > Found by static analysis > > Fixes: 8594b9c5bd456205255ea2241ba224f47480efad > Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Merged to master as of e812fd6053b92e8fae658b8731cc96c12f65270c
diff --git a/core/buddy.c b/core/buddy.c index 59cd2cb0fc86..b98a229d4950 100644 --- a/core/buddy.c +++ b/core/buddy.c @@ -286,6 +286,8 @@ struct buddy *buddy_create(unsigned int max_order) bsize = BITMAP_BYTES(1u << (max_order + 1)); b = zalloc(sizeof(struct buddy) + bsize); + if (!b) + return NULL; b->max_order = max_order; BUDDY_NOISE("Map @%p, size: %d bytes\n", b->map, bsize);
All callers of buddy_create() are correctly checking return value. Found by static analysis Fixes: 8594b9c5bd456205255ea2241ba224f47480efad Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> --- core/buddy.c | 2 ++ 1 file changed, 2 insertions(+)