Browse Source

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>
Emiliano Ingrassia 8 years ago
parent
commit
ed77d6bcaf
1 changed files with 1 additions and 1 deletions
  1. 1 1
      include/linux/spi/spi.h

+ 1 - 1
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);
 	}