summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-fsl-espi.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-04-02 16:21:04 +0200
committerMark Brown <broonie@linaro.org>2014-04-03 12:13:38 +0200
commit0a6d38795a405c49ea0012f04173613382def58c (patch)
tree41cca48cd41bdf3c9034b8f59ff5f4079f9bdaf2 /drivers/spi/spi-fsl-espi.c
parentLinux 3.14 (diff)
downloadlinux-0a6d38795a405c49ea0012f04173613382def58c.tar.xz
linux-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-fsl-espi.c')
-rw-r--r--drivers/spi/spi-fsl-espi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
index 428dc7a6b62e..e8e3d34bab07 100644
--- a/drivers/spi/spi-fsl-espi.c
+++ b/drivers/spi/spi-fsl-espi.c
@@ -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)