]> git.baikalelectronics.ru Git - kernel.git/commit
staging: r8188eu: always initialise efuse buffer with 0xff
authorMartin Kaiser <martin@kaiser.cx>
Sat, 9 Jul 2022 17:09:52 +0000 (19:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Jul 2022 08:06:45 +0000 (10:06 +0200)
commitd4b773d7098d7f3551d5de6f1dfa3264cdb4dd13
treee482c439f627025f62b6c80cc14d4fc691953a5a
parent06679f0720ea523b632c3c1a3ec08f49995e6709
staging: r8188eu: always initialise efuse buffer with 0xff

If BOOT_FROM_EEPROM is set, efuse_buf is not initialised before it is
passed to functions that read from it.

The buffer will be filled with 0x00 in this case like all local variables.
However, the parsing functions expect the buffer to be filled with 0xFF if
reading eeprom/efuse data failed. Fill the buffer with 0xFF before we try
to read the data.

Please note that this problem existed before we started using a local
buffer. Adapter->eeprompriv->efuse_eeprom_data was allocated as a part of
struct adapter by a vzalloc call in rtw_usb_if1_init.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220709171000.180481-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/usb_halinit.c