aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-txx9.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-04-02 22:21:04 +0800
committerMark Brown <broonie@linaro.org>2014-04-03 11:13:38 +0100
commit0a6d38795a405c49ea0012f04173613382def58c (patch)
tree41cca48cd41bdf3c9034b8f59ff5f4079f9bdaf2 /drivers/spi/spi-txx9.c
parentLinux 3.14 (diff)
downloadlinux-dev-0a6d38795a405c49ea0012f04173613382def58c.tar.xz
linux-dev-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 <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-txx9.c')
-rw-r--r--drivers/spi/spi-txx9.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c
index 6191ced514b2..57a14977101c 100644
--- a/drivers/spi/spi-txx9.c
+++ b/drivers/spi/spi-txx9.c
@@ -265,7 +265,8 @@ static void txx9spi_work_one(struct txx9spi *c, struct spi_message *m)
exit:
m->status = status;
- m->complete(m->context);
+ if (m->complete)
+ m->complete(m->context);
/* normally deactivate chipselect ... unless no error and
* cs_change has hinted that the next message will probably