summaryrefslogtreecommitdiff
path: root/drivers/calypsomodem
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-09-27 08:11:04 +0900
committerMarcel Holtmann <marcel@holtmann.org>2010-09-27 08:11:04 +0900
commitfcdd8b40b4de9f8a28608da39ab30478e915b18d (patch)
treec795e14c855e5cc158d85508f6ef488043a51595 /drivers/calypsomodem
parentd66e699a8890b3abd0bcf5c3e7871a9682e90583 (diff)
calypsomodem: Some cleanups in voice call driver
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);