summaryrefslogtreecommitdiffstats
path: root/include/linux/spi
diff options
context:
space:
mode:
authorEmiliano Ingrassia <ingrassia@epigenesys.com>2017-03-28 09:49:29 +0200
committerMark Brown <broonie@kernel.org>2017-03-29 11:40:39 +0100
commited77d6bcafd75d247cf3c6ad685aa221cda1b8ba (patch)
tree7a17ec9b2a5295720cb2e563d6d43305596ce845 /include/linux/spi
parentfafd67940774733fa97f4b09412aea6981b82e0a (diff)
downloadlinux-stable-ed77d6bcafd75d247cf3c6ad685aa221cda1b8ba.tar.gz
linux-stable-ed77d6bcafd75d247cf3c6ad685aa221cda1b8ba.tar.bz2
linux-stable-ed77d6bcafd75d247cf3c6ad685aa221cda1b8ba.zip
spi: dynamycally allocated message initialization
Invoke the proper function while initializing a dynamically allocated spi_message to avoid NULL pointer dereference during resources deallocation. Signed-off-by: Emiliano Ingrassia <ingrassia@epigenesys.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/spi')
-rw-r--r--include/linux/spi/spi.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 75c6bd0ac605..3b0070695375 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -891,7 +891,7 @@ static inline struct spi_message *spi_message_alloc(unsigned ntrans, gfp_t flags
unsigned i;
struct spi_transfer *t = (struct spi_transfer *)(m + 1);
- INIT_LIST_HEAD(&m->transfers);
+ spi_message_init_no_memset(m);
for (i = 0; i < ntrans; i++, t++)
spi_message_add_tail(t, m);
}