diff options
| author | Richard Leitner <[email protected]> | 2016-04-05 13:03:48 +0000 |
|---|---|---|
| committer | Jonathan Cameron <[email protected]> | 2016-04-17 11:16:36 +0000 |
| commit | 05be8d4101d960bad271d32b4f6096af1ccb1534 (patch) | |
| tree | 49d3ff2dcee32ea5e06b3adea30d221109a12a5a /fs/btrfs/dev-replace.c | |
| parent | iio: ak8975: Fix NULL pointer exception on early interrupt (diff) | |
| download | kernel-05be8d4101d960bad271d32b4f6096af1ccb1534.tar.gz kernel-05be8d4101d960bad271d32b4f6096af1ccb1534.zip | |
iio: ak8975: fix maybe-uninitialized warning
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 <[email protected]>
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions
