]> git.baikalelectronics.ru Git - kernel.git/commit
spi/acpi: avoid spurious matches during slave enumeration
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 20 Jun 2019 12:36:49 +0000 (14:36 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 24 Jun 2019 16:30:34 +0000 (17:30 +0100)
commit448d0856e5cb9885a587ce38e7a261cb3d12dd48
tree72ca08ad15fe0217c4bc5ea208b0ec15cb2bba8d
parente106853286f90afbcbcc9e4daec8632bf39ebc92
spi/acpi: avoid spurious matches during slave enumeration

In the new SPI ACPI slave enumeration code, we use the value of
lookup.max_speed_khz as a flag to decide whether a match occurred.
However, doing so only makes sense if we initialize its value to
zero beforehand, or otherwise, random junk from the stack will
cause spurious matches.

So zero initialize the lookup struct fully, and only set the non-zero
members explicitly.

Fixes: c2f08a4aec68 ("spi/acpi: enumerate all SPI slaves in the namespace")
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: andy.shevchenko@gmail.com
Cc: masahisa.kojima@linaro.org
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: linux-acpi@vger.kernel.org
Cc: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c