]> git.baikalelectronics.ru Git - kernel.git/commit
spi: imx: Gracefully handle NULL master->cs_gpios
authorMarek Vasut <marex@denx.de>
Mon, 26 Sep 2016 12:14:53 +0000 (14:14 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 26 Sep 2016 16:08:46 +0000 (09:08 -0700)
commit0aa04335ec9a84fae4e00856997e2092f84aaaee
treefd296df6645eb783150cac054f698331504a6980
parent3fea9fb2feb36d54c436615bab0916d0dbb47b8a
spi: imx: Gracefully handle NULL master->cs_gpios

It is possible that master->cs_gpios is NULL after spi_bitbang_start(),
this happens if the master has no CS GPIOs specified in DT. Check for
this case after spi_bitbang_start() to prevent NULL pointer dereference
in the subsequent for loop, which accesses the master->cs_gpios field.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Martin Kaiser <martin@kaiser.cx>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-imx.c