]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commit
iio: Fix unitialized use of list
authorSascha Hauer <s.hauer@pengutronix.de>
Tue, 3 Jul 2012 08:55:40 +0000 (10:55 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 8 Jul 2012 19:02:24 +0000 (20:02 +0100)
commit46b24311ccc8b37da9e6e006c6158229a5354268
tree7ff47f0e57a889c74331e6a903ab2f6acbcedd88
parenta91aff1c09fc41a55ccaa115763ff77e36b527d3
iio: Fix unitialized use of list

The dev_attr list is initialized in __iio_add_event_config_attrs which
is called only when indio_dev->channels is true. Nevertheless the list
is used unconditionally later in iio_device_register_eventset which
results in a NULL pointer exception. To fix this unconditionally
initialize the list in iio_device_register_eventset.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/industrialio-event.c