summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/client.c b/client.c
index 2449ee0..3fa313e 100644
--- a/client.c
+++ b/client.c
@@ -92,11 +92,26 @@ int ril_client_open(struct ril_client *client)
{
int rc = 0;
- if (client == NULL)
+ if (client == NULL) {
+ RIL_LOGD("%s: Skipping open due to Invalid client "
+ "(client is NULL)",
+ __func__);
+ return -1;
+ }
+
+ if (client->handlers == NULL) {
+ RIL_LOGD("%s: Skipping open due to Invalid client "
+ "(client->handlers is NULL)",
+ __func__);
return -1;
+ }
- if (client->handlers == NULL || client->handlers->open == NULL)
+ if (client->handlers->open == NULL) {
+ RIL_LOGD("%s: Skipping open due to Invalid client "
+ "(client->handlers->open is NULL)",
+ __func__);
return -1;
+ }
rc = client->handlers->open(client);
if (rc < 0) {
@@ -193,11 +208,24 @@ int ril_client_loop(struct ril_client *client)
pthread_attr_t attr;
int rc;
- if (client == NULL)
+ if (client == NULL) {
+ RIL_LOGD("%s: Skipping loop due to Invalid client "
+ "(client is NULL)", __func__);
+ return -1;
+ }
+
+ if (client->handlers == NULL) {
+ RIL_LOGD("%s: Skipping loop due to Invalid client "
+ "(client->handlers is NULL)", __func__);
return -1;
+ }
- if (client->handlers == NULL || client->handlers->loop == NULL)
+ if (client->handlers->loop == NULL) {
+ RIL_LOGD("%s: Skipping loop due to Invalid client "
+ "(client->handlers->loop is NULL)",
+ __func__);
return -1;
+ }
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);