]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: spi-mem: Add extra sanity checks on the op param
authorBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 10 Feb 2020 17:18:27 +0000 (10:18 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2020 21:33:24 +0000 (16:33 -0500)
commitb237f078cb25e1e1819e372b8876b106d0d2dbe1
tree446d94c6591074eaed7a051fb51458c78fbab715
parent1503649d8f0f6f3cf5d220fb7455bd980ceb26ab
spi: spi-mem: Add extra sanity checks on the op param

commit 380583227c0c7f52383b0cd5c0e2de93ed31d553 upstream

Some combinations are simply not valid and should be rejected before
the op is passed to the SPI controller driver.

Add an spi_mem_check_op() helper and use it in spi_mem_exec_op() and
spi_mem_supports_op() to make sure the spi-mem operation is valid.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable <stable@vger.kernel.org> # 4.19
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-mem.c