summaryrefslogtreecommitdiffstats
path: root/drivers/calypsomodem
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/calypsomodem')
-rw-r--r--drivers/calypsomodem/voicecall.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/calypsomodem/voicecall.c b/drivers/calypsomodem/voicecall.c
index a669cb7e..b2c9a962 100644
--- a/drivers/calypsomodem/voicecall.c
+++ b/drivers/calypsomodem/voicecall.c
@@ -27,6 +27,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
+#include <errno.h>
#include <glib.h>
@@ -382,13 +383,16 @@ static void calypso_voicecall_initialized(gboolean ok, GAtResult *result,
ofono_voicecall_register(vc);
}
-static int calypso_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
- void *data)
+static int calypso_voicecall_probe(struct ofono_voicecall *vc,
+ unsigned int vendor, void *data)
{
GAtChat *chat = data;
struct voicecall_data *vd;
- vd = g_new0(struct voicecall_data, 1);
+ vd = g_try_new0(struct voicecall_data, 1);
+ if (!vd)
+ return -ENOMEM;
+
vd->chat = g_at_chat_clone(chat);
ofono_voicecall_set_data(vc, vd);