summaryrefslogtreecommitdiffstats
path: root/tools/iio/iio_event_monitor.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 20:21:10 +0200
commite9e45b43b8f06273d9b78f187042dff0bf5be0a5 (patch)
tree2e0bb238e6b234a12366c545e879b9b6646b9985 /tools/iio/iio_event_monitor.c
parenttools:iio:iio_utils: mark private function static (diff)
downloadlinux-e9e45b43b8f06273d9b78f187042dff0bf5be0a5.tar.xz
linux-e9e45b43b8f06273d9b78f187042dff0bf5be0a5.zip
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/iio_event_monitor.c')
-rw-r--r--tools/iio/iio_event_monitor.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c
index 578390db1bec..1374374208ee 100644
--- a/tools/iio/iio_event_monitor.c
+++ b/tools/iio/iio_event_monitor.c
@@ -265,6 +265,8 @@ int main(int argc, char **argv)
/* If we can't find a IIO device by name assume device_name is a
IIO chrdev */
chrdev_name = strdup(device_name);
+ if (!chrdev_name)
+ return -ENOMEM;
}
fd = open(chrdev_name, 0);