spi: Always check complete callback before calling it
Since commit 1e25cd4729
"spi: Do not require a completion", this checking is
required to prevent NULL pointer dereference.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
455c6fdbd2
commit
0a6d38795a
7 changed files with 18 additions and 9 deletions
|
@ -301,7 +301,8 @@ static int mpc512x_psc_spi_msg_xfer(struct spi_master *master,
|
|||
}
|
||||
|
||||
m->status = status;
|
||||
m->complete(m->context);
|
||||
if (m->complete)
|
||||
m->complete(m->context);
|
||||
|
||||
if (status || !cs_change)
|
||||
mpc512x_psc_spi_deactivate_cs(spi);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue