From b497e06d2714b22200e0bad76111229c960debd5 Mon Sep 17 00:00:00 2001 From: Paulo Miguel Almeida Date: Sat, 26 Feb 2022 17:25:31 +1300 Subject: [PATCH] staging: pi433: prevent uninitialized data from being printed out local_buffer is not initialised before data is passed to spi_sync_transfer. In case spi* function fails then the dev_dbg statement after that can potentially print out uninitialised data this patch initialises local_buffer array. Signed-off-by: Paulo Miguel Almeida Link: https://lore.kernel.org/r/Yhmruyr2BUn0+3O3@mail.google.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/pi433/rf69.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c index e5b23ab39c69..3028018f0b45 100644 --- a/drivers/staging/pi433/rf69.c +++ b/drivers/staging/pi433/rf69.c @@ -782,7 +782,7 @@ int rf69_read_fifo(struct spi_device *spi, u8 *buffer, unsigned int size) { int i; struct spi_transfer transfer; - u8 local_buffer[FIFO_SIZE + 1]; + u8 local_buffer[FIFO_SIZE + 1] = {}; int retval; if (size > FIFO_SIZE) {