android_kernel_xiaomi_sm8450/drivers/misc/eeprom
Dan Carpenter 5bcc37dc24 eeprom: idt_89hpesx: uninitialized data in idt_dbgfs_csr_write()
[ Upstream commit 71d46f1ff2212ced4852c7e77c5176382a1bdcec ]

The simple_write_to_buffer() function will return positive/success if it
is able to write a single byte anywhere within the buffer.  However that
potentially leaves a lot of the buffer uninitialized.

In this code it's better to return 0 if the offset is non-zero.  This
code is not written to support partial writes.  And then return -EFAULT
if the buffer is not completely initialized.

Fixes: cfad642538 ("eeprom: Add IDT 89HPESx EEPROM/CSR driver")
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Ysg1Pu/nzSMe3r1q@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-21 15:16:00 +02:00
..
at24.c misc: eeprom: at24: Always append device id even if label property is set. 2021-07-28 14:35:46 +02:00
at25.c eeprom: at25: set type id as EEPROM 2020-09-17 18:47:20 +02:00
digsy_mtc_eeprom.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ee1004.c eeprom: ee1004: limit i2c reads to I2C_SMBUS_BLOCK_MAX 2022-02-16 12:54:27 +01:00
eeprom_93cx6.c misc: eeprom: eeprom_93cx6: Repair function arg descriptions 2020-06-29 18:45:52 +02:00
eeprom_93xx46.c misc: eeprom_93xx46: Add quirk to support Microchip 93LC46B eeprom 2021-03-11 14:17:27 +01:00
eeprom.c misc: eeprom: use helper to get i2c_client from kobj 2020-09-21 11:45:43 +02:00
idt_89hpesx.c eeprom: idt_89hpesx: uninitialized data in idt_dbgfs_csr_write() 2022-08-21 15:16:00 +02:00
Kconfig eeprom: Deprecate the legacy eeprom driver 2019-09-04 09:57:35 +02:00
Makefile eeprom: New ee1004 driver for DDR4 memory 2018-10-15 20:51:46 +02:00
max6875.c misc: eeprom: max6875: convert to i2c_new_dummy_device 2019-07-25 10:06:54 +02:00