]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
staging: pi433: prevent uninitialized data from being printed out
authorPaulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Sat, 26 Feb 2022 04:25:31 +0000 (17:25 +1300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Mar 2022 21:39:37 +0000 (22:39 +0100)
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 <paulo.miguel.almeida.rodenas@gmail.com>
Link: https://lore.kernel.org/r/Yhmruyr2BUn0+3O3@mail.google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/pi433/rf69.c

index e5b23ab39c694114ee4b912eabc57a8771e9eeda..3028018f0b45ecc2ded7f6e9b3b46d571a44b307 100644 (file)
@@ -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) {