summaryrefslogtreecommitdiffstats
path: root/tools/iio/generic_buffer.c
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2015-05-31 14:40:02 +0200
committerJonathan Cameron <jic23@kernel.org>2015-05-31 19:21:10 +0100
commite9e45b43b8f06273d9b78f187042dff0bf5be0a5 (patch)
tree2e0bb238e6b234a12366c545e879b9b6646b9985 /tools/iio/generic_buffer.c
parent2156b179993e3d5b422976181ba17d91153313e1 (diff)
downloadop-kernel-dev-e9e45b43b8f06273d9b78f187042dff0bf5be0a5.zip
op-kernel-dev-e9e45b43b8f06273d9b78f187042dff0bf5be0a5.tar.gz
tools:iio: catch errors in string allocation
This patch catches errors in string allocation in generic_buffer.c, iio_event_monitor.c, iio_utils.c and lsiio.c. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'tools/iio/generic_buffer.c')
-rw-r--r--tools/iio/generic_buffer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c
index 4cd2464..eb89bc2 100644
--- a/tools/iio/generic_buffer.c
+++ b/tools/iio/generic_buffer.c
@@ -234,7 +234,9 @@ int main(int argc, char **argv)
}
printf("iio device number being used is %d\n", dev_num);
- asprintf(&dev_dir_name, "%siio:device%d", iio_dir, dev_num);
+ ret = asprintf(&dev_dir_name, "%siio:device%d", iio_dir, dev_num);
+ if (ret < 0)
+ return -ENOMEM;
if (!notrigger) {
if (trigger_name == NULL) {
OpenPOWER on IntegriCloud