diff options
Diffstat (limited to 'tools/iio/generic_buffer.c')
-rw-r--r-- | tools/iio/generic_buffer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c index 4cd246426b57..eb89bc2ca5d0 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) { |