Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed77d6bc authored by Emiliano Ingrassia's avatar Emiliano Ingrassia Committed by Mark Brown
Browse files

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: default avatarEmiliano Ingrassia <ingrassia@epigenesys.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent fafd6794
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -891,7 +891,7 @@ static inline struct spi_message *spi_message_alloc(unsigned ntrans, gfp_t flags
		unsigned i;
		unsigned i;
		struct spi_transfer *t = (struct spi_transfer *)(m + 1);
		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++)
		for (i = 0; i < ntrans; i++, t++)
			spi_message_add_tail(t, m);
			spi_message_add_tail(t, m);
	}
	}