diff options
author | Cyril Bur <cyril.bur@au1.ibm.com> | 2016-07-11 11:35:09 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-07-11 11:54:08 +1000 |
commit | d6767a5ffa139abb70af8dce7baae7be9bc89817 (patch) | |
tree | a3acaec093afc6241e56f66efaa43c769c1dfff0 /platforms/mambo/mambo.c | |
parent | 3f81b52c11271e4283c3add34e4275c7a66ad4b3 (diff) | |
download | skiboot-d6767a5ffa139abb70af8dce7baae7be9bc89817.zip skiboot-d6767a5ffa139abb70af8dce7baae7be9bc89817.tar.gz skiboot-d6767a5ffa139abb70af8dce7baae7be9bc89817.tar.bz2 |
mambo: Add NULL checks and error messages
While it extremely unlikely that these paths will ever by triggered
the error message could be useful to help diagnose a broken system.
This patch also fixes coverity issue 127700
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'platforms/mambo/mambo.c')
-rw-r--r-- | platforms/mambo/mambo.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platforms/mambo/mambo.c b/platforms/mambo/mambo.c index 154c734..69e0796 100644 --- a/platforms/mambo/mambo.c +++ b/platforms/mambo/mambo.c @@ -197,6 +197,12 @@ static void bogus_disk_flash_init(void) bl = zalloc(sizeof(struct blocklevel_device)); bdi = zalloc(sizeof(struct bogus_disk_info)); + if (!bl || !bdi) { + free(bl); + free(bdi); + prerror("mambo: Failed to start bogus disk, ENOMEM\n"); + return; + } bl->read = &bogus_disk_read; bl->write = &bogus_disk_write; |