From 66a74e40427314d660e115b7e56ff66a7f6822ba Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Fri, 18 Jun 2021 11:33:59 +0100 Subject: [PATCH] local: Handle errors of set_channel_name() Handle errors of set_channel_name() instead of ignoring them. Signed-off-by: Paul Cercueil --- local.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/local.c b/local.c index 2ee73f1b4..b23170462 100644 --- a/local.c +++ b/local.c @@ -1799,7 +1799,10 @@ static int create_device(void *d, const char *path) for (i = 0; i < dev->nb_channels; i++) { struct iio_channel *chn = dev->channels[i]; - set_channel_name(chn); + ret = set_channel_name(chn); + if (ret < 0) + goto err_free_scan_elements; + ret = handle_scan_elements(chn); free_protected_attrs(chn); if (ret < 0)