Patch "iio: ak8975: fix maybe-uninitialized warning" has been added to the 4.5-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
iio: ak8975: fix maybe-uninitialized warning
to the 4.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
iio-ak8975-fix-maybe-uninitialized-warning.patch
and it can be found in the queue-4.5 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
05be8d4101d960bad271d32b4f6096af1ccb1534Mon Sep 17 00:00:00 2001
From: Richard Leitner <[email protected]>
Date: Tue, 5 Apr 2016 15:03:48 +0200
Subject: iio: ak8975: fix maybe-uninitialized warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Richard Leitner <[email protected]>
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];
--- drivers/iio/magnetometer/ak8975.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/magnetometer/ak8975.c +1 -1
@@ -732,7 +732,7 @@ static int ak8975_probe(struct i2c_clienint eoc_gpio;int err;const char *name =NULL ; -enum asahi_compass_chipset chipset; +enum asahi_compass_chipset chipset =AK_MAX_TYPE ;/* Grab and set up the supplied GPIO. */ if (client->dev.platform_data)
Patches currently in stable-queue which might be from [email protected] are
queue-4.5/iio-ak8975-fix-maybe-uninitialized-warning.patch