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:
@@ -248,7 +248,8 @@ static void mpc52xx_psc_spi_work(struct work_struct *work)
|
||||
}
|
||||
|
||||
m->status = status;
|
||||
m->complete(m->context);
|
||||
if (m->complete)
|
||||
m->complete(m->context);
|
||||
|
||||
if (status || !cs_change)
|
||||
mpc52xx_psc_spi_deactivate_cs(spi);
|
||||
|
Reference in New Issue
Block a user