summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2013-03-31 16:01:45 +0200
committerPaul Kocialkowski <contact@paulk.fr>2013-03-31 16:01:45 +0200
commit35a061b787bafcf7cd82f186a66ab8199da4f2e4 (patch)
tree080c0b563a6b93be258af63575191359c25cd6c3
parent88584d95aaf80554e5d904fc0e7cf610fc85a3eb (diff)
downloadhardware_ril_samsung-ril-35a061b787bafcf7cd82f186a66ab8199da4f2e4.zip
hardware_ril_samsung-ril-35a061b787bafcf7cd82f186a66ab8199da4f2e4.tar.gz
hardware_ril_samsung-ril-35a061b787bafcf7cd82f186a66ab8199da4f2e4.tar.bz2
gen: Refactor code, check for NULL pointers and prevent memory leaks
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--gen.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gen.c b/gen.c
index f4e9d56..1c56837 100644
--- a/gen.c
+++ b/gen.c
@@ -43,7 +43,7 @@
* send some data to the modem, just liek this:
* aseq = ril_request_reg_id(ril_request_get_token(info->aseq));
*
- * Please use GEN_PHONE_RES engine as often as possible!
+ * Please use the GEN_PHONE_RES engine as often as possible!
*/
/*
@@ -145,10 +145,6 @@ int ipc_gen_phone_res_expect_to_abort(unsigned char aseq, unsigned short command
* GEN dequeue function
*/
-/*
- * In: IPC_GEN_PHONE_RES
- * Check the ipc_gen_phone_res_expects queue and act accordingly
- */
void ipc_gen_phone_res(struct ipc_message_info *info)
{
struct ipc_gen_phone_res_expect_info *expect;
@@ -156,7 +152,7 @@ void ipc_gen_phone_res(struct ipc_message_info *info)
RIL_Errno e;
int rc;
- if (info->data == NULL || info->length < sizeof(struct ipc_gen_phone_res))
+ if (info == NULL || info->data == NULL || info->length < sizeof(struct ipc_gen_phone_res))
return;
phone_res = (struct ipc_gen_phone_res *) info->data;