]> git.karo-electronics.de Git - linux-beck.git/commit
tools: iio: iio_generic_buffer: initialize channel array pointer
authorAlison Schofield <amsfield22@gmail.com>
Wed, 27 Jul 2016 03:17:43 +0000 (20:17 -0700)
committerJonathan Cameron <jic23@kernel.org>
Mon, 15 Aug 2016 16:05:30 +0000 (17:05 +0100)
commitddbc719f99cf9aed6918cef98cb3475fd4fc4fa6
tree70a3b81e810ada06a5426e0d3e8a17918b28c255
parent0d9dcf852334b796bacc7020364afba3122db81e
tools: iio: iio_generic_buffer: initialize channel array pointer

Uninitialized channel pointer causes segmentation fault when we
call free(channel) during cleanup() with no channels initialized.
This happens when you exit early for usage errors.  Initialize
the pointer to NULL when it is declared.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Tested-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
tools/iio/iio_generic_buffer.c