spi: ti-qspi: Make sure res_mmap != NULL before dereferencing it
authorBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 14 May 2018 09:11:29 +0000 (11:11 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 17 May 2018 04:36:00 +0000 (13:36 +0900)
commit6282f122913e632c2415c236a2b5faa8ef368b10
treecaf37309a29de025cc9785ab99b8d0914ad82a47
parente935dba111621bd6a0c5d48e6511a4d9885103b4
spi: ti-qspi: Make sure res_mmap != NULL before dereferencing it

resource_size() is dereferencing the res without checking that it is
not NULL, so we need to do the check before calling resource_size().

Fixes: b95cb394ab59 ("spi: ti-qspi: Implement the spi_mem interface")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-ti-qspi.c