android_kernel_oneplus_msm8998/drivers/iio/magnetometer
Richard Leitner 0f5c3afc75 iio: ak8975: fix maybe-uninitialized warning
commit 05be8d4101d960bad271d32b4f6096af1ccb1534 upstream.

If i2c_device_id *id is NULL and acpi_match_device returns NULL too,
then chipset may be unitialized when accessing &ak_def_array[chipset] in
ak8975_probe. Therefore initialize chipset to AK_MAX_TYPE, which will
return an error when not changed.

This patch fixes the following maybe-uninitialized warning:

drivers/iio/magnetometer/ak8975.c: In function ‘ak8975_probe’:
drivers/iio/magnetometer/ak8975.c:788:14: warning: ‘chipset’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
  data->def = &ak_def_array[chipset];

Signed-off-by: Richard Leitner <dev@g0hl1n.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-11 11:21:23 +02:00
..
ak8975.c iio: ak8975: fix maybe-uninitialized warning 2016-05-11 11:21:23 +02:00
bmc150_magn.c iio: remove gpio interrupt probing from drivers that use a single interrupt 2015-10-03 12:05:51 +01:00
hid-sensor-magn-3d.c iio: hid-sensor-magn-3d: Constify platform_device_id 2015-05-10 20:31:47 +01:00
Kconfig iio:magnetometer:bmc150_magn: sort entry alphabetically 2015-08-12 22:18:21 +01:00
mag3110.c iio: magnetometer: mag3110: Place driver on standby on error 2015-04-01 17:24:09 +02:00
Makefile iio:magnetometer:bmc150_magn: sort entry alphabetically 2015-08-12 22:18:21 +01:00
mmc35240.c Second set of new device support, features and cleanup for the 4.3 cycle. 2015-08-12 12:43:41 -07:00
st_magn.h iio: st_magn: always define ST_MAGN_TRIGGER_SET_STATE 2016-04-20 15:42:11 +09:00
st_magn_buffer.c iio: st_magn: Add irq trigger handling 2015-07-23 20:43:13 +01:00
st_magn_core.c iio: st_sensors: add debugfs register read hook 2015-08-16 10:51:25 +01:00
st_magn_i2c.c iio: st-magn: add support for lsm303agr magnetometer 2015-07-23 20:43:27 +01:00
st_magn_spi.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00