From: Paulo Miguel Almeida Date: Sat, 26 Feb 2022 04:25:31 +0000 (+1300) Subject: staging: pi433: prevent uninitialized data from being printed out X-Git-Tag: howlett/maple/20220722_2~883^2~71 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b497e06d2714b22200e0bad76111229c960debd5;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c index e5b23ab39c694..3028018f0b45e 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) {