mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 12:10:52 -04:00
spi: rspi: Fix NULL pointer dereference on SH7757
SH7757 doesn't pass platform data, in which case spi-rspi uses default
parameters.
However, commit 5ce0ba8865 ("spi: rcar: add
Renesas QSPI support on RSPI") added a new user of the platform data, but
forgot to check for its validity first, causing a NULL pointer dereference
on SH7757.
Add the missing check to fix this.
Signed-off-by: Geert Uytterhoeven <[email protected]>
Acked-by: Simon Horman <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
parent
6ce4eac1f6
commit
efd85acb4f
1 changed files with 3 additions and 2 deletions
|
|
@ -958,8 +958,9 @@ static int rspi_probe(struct platform_device *pdev)
|
|||
INIT_WORK(&rspi->ws, rspi_work);
|
||||
init_waitqueue_head(&rspi->wait);
|
||||
|
||||
master->num_chipselect = rspi_pd->num_chipselect;
|
||||
if (!master->num_chipselect)
|
||||
if (rspi_pd && rspi_pd->num_chipselect)
|
||||
master->num_chipselect = rspi_pd->num_chipselect;
|
||||
else
|
||||
master->num_chipselect = 2; /* default */
|
||||
|
||||
master->bus_num = pdev->id;
|
||||
|
|
|
|||
Loading…
Reference in a new issue