tools:iio: return values directly
Return directly, if no common cleanup is required.
Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c
index 1316527..7f56238b 100644
--- a/tools/iio/iio_event_monitor.c
+++ b/tools/iio/iio_event_monitor.c
@@ -258,8 +258,7 @@
device_name, dev_num);
ret = asprintf(&chrdev_name, "/dev/iio:device%d", dev_num);
if (ret < 0) {
- ret = -ENOMEM;
- goto error_ret;
+ return -ENOMEM;
}
} else {
/* If we can't find a IIO device by name assume device_name is a
@@ -312,6 +311,6 @@
error_free_chrdev_name:
free(chrdev_name);
-error_ret:
+
return ret;
}