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)
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>

No differences found