2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-22 04:24:02 +08:00

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 <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>
This commit is contained in:
Paulo Miguel Almeida 2022-02-26 17:25:31 +13:00 committed by Greg Kroah-Hartman
parent 095f746502
commit b497e06d27

View 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) {