diff options
| author | Axel Lin <[email protected]> | 2014-04-02 14:21:04 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2014-04-03 10:13:38 +0000 |
| commit | 0a6d38795a405c49ea0012f04173613382def58c (patch) | |
| tree | 41cca48cd41bdf3c9034b8f59ff5f4079f9bdaf2 /drivers/spi/spi-fsl-spi.c | |
| parent | Linux 3.14 (diff) | |
| download | kernel-0a6d38795a405c49ea0012f04173613382def58c.tar.gz kernel-0a6d38795a405c49ea0012f04173613382def58c.zip | |
spi: Always check complete callback before calling it
Since commit 1e25cd4729bd "spi: Do not require a completion", this checking is
required to prevent NULL pointer dereference.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'drivers/spi/spi-fsl-spi.c')
| -rw-r--r-- | drivers/spi/spi-fsl-spi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index 119f7af94537..f2af3eb3ceb7 100644 --- a/drivers/spi/spi-fsl-spi.c +++ b/drivers/spi/spi-fsl-spi.c @@ -404,7 +404,8 @@ static void fsl_spi_do_one_msg(struct spi_message *m) } m->status = status; - m->complete(m->context); + if (m->complete) + m->complete(m->context); if (status || !cs_change) { ndelay(nsecs); |
