aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-06-14 05:12:59 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-06-26 02:11:35 +0200
commit7252f5a6d331aebaa71ad940aecf543aa164514a (patch)
tree4bbaa1be667ff28c200ff62ad64e2ec6dc1ae6cc
parentbbc27e4c2e60113ad172ae8384d2da0891558115 (diff)
downloadhardware_replicant_libsamsung-ipc-7252f5a6d331aebaa71ad940aecf543aa164514a.tar.gz
hardware_replicant_libsamsung-ipc-7252f5a6d331aebaa71ad940aecf543aa164514a.tar.bz2
hardware_replicant_libsamsung-ipc-7252f5a6d331aebaa71ad940aecf543aa164514a.zip
xmm626_kernel_smdk4412_gprs_get_iface: handle asprintf errors
Without that fix we have the following warning: CC modems/xmm626/xmm626_kernel_smdk4412.lo ../../../samsung-ipc/modems/xmm626/xmm626_kernel_smdk4412.c: In function 'xmm626_kernel_smdk4412_gprs_get_iface': ../../../samsung-ipc/modems/xmm626/xmm626_kernel_smdk4412.c:589:9: warning: ignoring return value of 'asprintf' declared with attribute 'warn_unused_result' [-Wunused-result] 589 | asprintf(&iface, "%s%d", XMM626_[...]_IFACE_PREFIX, cid - 1); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CC modems/xmm626/xmm626_mipi.lo Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--samsung-ipc/modems/xmm626/xmm626_kernel_smdk4412.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/samsung-ipc/modems/xmm626/xmm626_kernel_smdk4412.c b/samsung-ipc/modems/xmm626/xmm626_kernel_smdk4412.c
index c6b1578..a8de89c 100644
--- a/samsung-ipc/modems/xmm626/xmm626_kernel_smdk4412.c
+++ b/samsung-ipc/modems/xmm626/xmm626_kernel_smdk4412.c
@@ -582,11 +582,17 @@ char *xmm626_kernel_smdk4412_gprs_get_iface(
__attribute__((unused)) struct ipc_client *client, unsigned int cid)
{
char *iface = NULL;
+ int rc;
if (cid > XMM626_SEC_MODEM_GPRS_IFACE_COUNT)
return NULL;
- asprintf(&iface, "%s%d", XMM626_SEC_MODEM_GPRS_IFACE_PREFIX, cid - 1);
+ rc = asprintf(&iface, "%s%d",
+ XMM626_SEC_MODEM_GPRS_IFACE_PREFIX, cid - 1);
+ if (rc == -1) {
+ ipc_client_log(client, "%s: asprintf failed", __func__);
+ return NULL;
+ }
return iface;
}