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: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NJonathan Cameron <jic23@kernel.org>
Showing
想要评论请 注册 或 登录