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:
@@ -446,7 +446,8 @@ static void fsl_espi_do_one_msg(struct spi_message *m)
|
||||
|
||||
m->actual_length = espi_trans.actual_length;
|
||||
m->status = espi_trans.status;
|
||||
m->complete(m->context);
|
||||
if (m->complete)
|
||||
m->complete(m->context);
|
||||
}
|
||||
|
||||
static int fsl_espi_setup(struct spi_device *spi)
|
||||
|
Reference in New Issue
Block a user