linux/drivers/misc/eeprom
Armin Wolf e6cd0dc91e eeprom: ee1004: Fix locking issues in ee1004_probe()
Currently, the devres-based management of ee1004_bus_data has
several issues when it comes to locking:

1. It does not call mutex_unlock() before returning an error.

2. When encountering an error, it deadlocks when trying to recursively
   lock a mutex.

Fix this by moving the mutex-protected bus data initialization into
a separate function so that devm_add_action_or_reset() is called
without the mutex being held.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Fixes: 55d57ef6fa ("eeprom: ee1004: Use devres for bus data cleanup")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20240713234813.21746-1-W_Armin@gmx.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-07-31 13:41:42 +02:00
..
at24.c eeprom: at24: Add support for Microchip 24AA025E48/24AA025E64 EEPROMs 2024-07-03 11:55:59 +02:00
at25.c eeprom: at25: drop unneeded MODULE_ALIAS 2024-04-29 11:14:00 +02:00
digsy_mtc_eeprom.c eeprom: digsy_mtc: Convert to use GPIO descriptors 2024-06-04 17:47:08 +02:00
ee1004.c eeprom: ee1004: Fix locking issues in ee1004_probe() 2024-07-31 13:41:42 +02:00
eeprom_93cx6.c
eeprom_93xx46.c misc: eeprom_93xx46: Convert to DEVICE_ATTR_WO() 2024-06-04 17:47:08 +02:00
idt_89hpesx.c eeprom: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-06-04 17:47:27 +02:00
Kconfig eeprom: ee1004: Add nvmem support 2024-07-04 12:02:56 +02:00
Makefile eeprom: Remove deprecated legacy eeprom driver 2023-10-05 11:09:40 +02:00
max6875.c eeprom: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-06-04 17:47:27 +02:00