diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-02-23 14:21:55 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-03-02 18:22:51 +1100 |
commit | e812fd6053b92e8fae658b8731cc96c12f65270c (patch) | |
tree | f304935cff17b74534fa8d54d3d4cf5421d40a0d /core/buddy.c | |
parent | 0d31de63ff037a4a0d77ce96005977b62ce12532 (diff) | |
download | blackbird-skiboot-e812fd6053b92e8fae658b8731cc96c12f65270c.tar.gz blackbird-skiboot-e812fd6053b92e8fae658b8731cc96c12f65270c.zip |
buddy: Check zalloc() return value
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>
Diffstat (limited to 'core/buddy.c')
-rw-r--r-- | core/buddy.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/buddy.c b/core/buddy.c index 59cd2cb0..b98a229d 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); |