diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2012-09-10 18:27:47 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2012-09-10 18:27:47 +0200 |
commit | 7a3189f6b12fd788b023785da9ef262890269778 (patch) | |
tree | a51ce0fa3132831dfbf649f0f350da16ff269295 | |
parent | c274c5bfe67e4e9437af75279cc3b66cfb523b07 (diff) | |
download | hardware_replicant_libsamsung-ipc-7a3189f6b12fd788b023785da9ef262890269778.tar.gz hardware_replicant_libsamsung-ipc-7a3189f6b12fd788b023785da9ef262890269778.tar.bz2 hardware_replicant_libsamsung-ipc-7a3189f6b12fd788b023785da9ef262890269778.zip |
ipc: fix gprs_get_iface functions
Change-Id: Idea112725ca55ea341d11055a332b1c8625e614c
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r-- | include/radio.h | 2 | ||||
-rw-r--r-- | samsung-ipc/device/aries/aries_ipc.c | 6 | ||||
-rw-r--r-- | samsung-ipc/device/crespo/crespo_ipc.c | 8 | ||||
-rw-r--r-- | samsung-ipc/device/xmm6260/xmm6260_ipc.c | 6 | ||||
-rw-r--r-- | samsung-ipc/ipc.c | 2 |
5 files changed, 13 insertions, 11 deletions
diff --git a/include/radio.h b/include/radio.h index bba9e60..55de7dd 100644 --- a/include/radio.h +++ b/include/radio.h @@ -88,7 +88,7 @@ int ipc_client_power_off(struct ipc_client *client); int ipc_client_gprs_handlers_available(struct ipc_client *client); int ipc_client_gprs_activate(struct ipc_client *client); int ipc_client_gprs_deactivate(struct ipc_client *client); -char* ipc_client_gprs_get_iface(struct ipc_client *client, int cid); +char *ipc_client_gprs_get_iface(struct ipc_client *client, int cid); int ipc_client_gprs_get_capabilities(struct ipc_client *client, struct ipc_client_gprs_capabilities *cap); int ipc_client_recv(struct ipc_client *client, struct ipc_message_info *response); diff --git a/samsung-ipc/device/aries/aries_ipc.c b/samsung-ipc/device/aries/aries_ipc.c index d987822..9741764 100644 --- a/samsung-ipc/device/aries/aries_ipc.c +++ b/samsung-ipc/device/aries/aries_ipc.c @@ -835,10 +835,10 @@ int aries_ipc_gprs_deactivate(void *data) return 0; } -char* aries_ipc_gprs_get_iface(int cid) +char *aries_ipc_gprs_get_iface(int cid) { struct ifreq ifr; - char *iface; + char *iface = NULL; int fd; int rc; int i; @@ -854,7 +854,7 @@ char* aries_ipc_gprs_get_iface(int cid) if(rc < 0 || ifr.ifr_flags & IFF_UP) { continue; } else { - asprintf(iface, "%s%d", GPRS_IFACE_PREFIX, i); + asprintf(&iface, "%s%d", GPRS_IFACE_PREFIX, i); return iface; } } diff --git a/samsung-ipc/device/crespo/crespo_ipc.c b/samsung-ipc/device/crespo/crespo_ipc.c index 437c680..31e2bd5 100644 --- a/samsung-ipc/device/crespo/crespo_ipc.c +++ b/samsung-ipc/device/crespo/crespo_ipc.c @@ -587,10 +587,12 @@ int crespo_ipc_power_off(void *io_data) return 0; } -char* crespo_ipc_gprs_get_iface(int cid) +char *crespo_ipc_gprs_get_iface(int cid) { - char *iface; - asprintf(iface, "%s%d", GPRS_IFACE_PREFIX, 0); + char *iface = NULL; + + asprintf(&iface, "%s%d", GPRS_IFACE_PREFIX, 0); + return iface; } diff --git a/samsung-ipc/device/xmm6260/xmm6260_ipc.c b/samsung-ipc/device/xmm6260/xmm6260_ipc.c index f7fbcc9..01a6fee 100644 --- a/samsung-ipc/device/xmm6260/xmm6260_ipc.c +++ b/samsung-ipc/device/xmm6260/xmm6260_ipc.c @@ -344,14 +344,14 @@ int xmm6260_ipc_power_off(void *io_data) return 0; } -char* xmm6260_ipc_gprs_get_iface(int cid) +char *xmm6260_ipc_gprs_get_iface(int cid) { - char *iface; + char *iface = NULL; if(cid > GPRS_IFACE_COUNT) return NULL; - asprintf(iface, "%s%d", GPRS_IFACE_PREFIX, cid - 1); + asprintf(&iface, "%s%d", GPRS_IFACE_PREFIX, cid - 1); return iface; } diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c index 62bce28..a21575e 100644 --- a/samsung-ipc/ipc.c +++ b/samsung-ipc/ipc.c @@ -399,7 +399,7 @@ int ipc_client_gprs_deactivate(struct ipc_client *client) return client->handlers->gprs_deactivate(client->handlers->gprs_deactivate_data); } -char* ipc_client_gprs_get_iface(struct ipc_client *client, int cid) +char *ipc_client_gprs_get_iface(struct ipc_client *client, int cid) { if (client == NULL || client->gprs_specs == NULL || |