summaryrefslogtreecommitdiffstats
path: root/hw/fsp
diff options
context:
space:
mode:
Diffstat (limited to 'hw/fsp')
-rw-r--r--hw/fsp/fsp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c
index 888da88d..26cad638 100644
--- a/hw/fsp/fsp.c
+++ b/hw/fsp/fsp.c
@@ -249,8 +249,14 @@ struct fsp_msg *fsp_allocmsg(bool alloc_response)
msg = __fsp_allocmsg();
if (!msg)
return NULL;
- if (alloc_response)
+ if (alloc_response) {
msg->resp = __fsp_allocmsg();
+ if (!msg->resp) {
+ free(msg);
+ return NULL;
+ }
+ }
+
return msg;
}
OpenPOWER on IntegriCloud