summaryrefslogtreecommitdiffstats
path: root/hwaccess.c
diff options
context:
space:
mode:
Diffstat (limited to 'hwaccess.c')
-rw-r--r--hwaccess.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hwaccess.c b/hwaccess.c
index efe8bb0e9..8c89925e2 100644
--- a/hwaccess.c
+++ b/hwaccess.c
@@ -226,6 +226,10 @@ int undo_mmio_write(void *p)
{ \
struct undo_mmio_write_data *undo_mmio_write_data; \
undo_mmio_write_data = malloc(sizeof(struct undo_mmio_write_data)); \
+ if (!undo_mmio_write_data) { \
+ msg_gerr("Out of memory!\n"); \
+ exit(1); \
+ } \
undo_mmio_write_data->addr = a; \
undo_mmio_write_data->type = mmio_write_type_##c; \
undo_mmio_write_data->c##data = mmio_read##c(a); \