Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 6282f122 authored by Boris Brezillon's avatar Boris Brezillon Committed by Mark Brown
Browse files

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: b95cb394 ("spi: ti-qspi: Implement the spi_mem interface")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent e935dba1
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -718,6 +718,8 @@ static int ti_qspi_probe(struct platform_device *pdev)
				"memory mapped resource not required\n");
				"memory mapped resource not required\n");
		}
		}
	}
	}

	if (res_mmap)
		qspi->mmap_size = resource_size(res_mmap);
		qspi->mmap_size = resource_size(res_mmap);


	irq = platform_get_irq(pdev, 0);
	irq = platform_get_irq(pdev, 0);