From fcdd8b40b4de9f8a28608da39ab30478e915b18d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 27 Sep 2010 08:11:04 +0900 Subject: [PATCH] calypsomodem: Some cleanups in voice call driver --- drivers/calypsomodem/voicecall.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/calypsomodem/voicecall.c b/drivers/calypsomodem/voicecall.c index a669cb7..b2c9a96 100644 --- a/drivers/calypsomodem/voicecall.c +++ b/drivers/calypsomodem/voicecall.c @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -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); -- 2.7.4