diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-04-02 22:21:04 +0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-04-03 11:13:38 +0100 |
commit | 0a6d38795a405c49ea0012f04173613382def58c (patch) | |
tree | 41cca48cd41bdf3c9034b8f59ff5f4079f9bdaf2 /drivers/spi/spi-mpc52xx-psc.c | |
parent | 455c6fdbd219161bd09b1165f11699d6d73de11c (diff) | |
download | linux-0a6d38795a405c49ea0012f04173613382def58c.tar.bz2 |
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 <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-mpc52xx-psc.c')
-rw-r--r-- | drivers/spi/spi-mpc52xx-psc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c index 00ba910ab302..d761bc0dc5ce 100644 --- a/drivers/spi/spi-mpc52xx-psc.c +++ b/drivers/spi/spi-mpc52xx-psc.c @@ -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); |