mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-16 09:13:55 +08:00
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: b95cb394ab
("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>
This commit is contained in:
parent
e935dba111
commit
6282f12291
@ -718,6 +718,8 @@ static int ti_qspi_probe(struct platform_device *pdev)
|
||||
"memory mapped resource not required\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (res_mmap)
|
||||
qspi->mmap_size = resource_size(res_mmap);
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user