Commit df2f0c49 authored by Daniel Okazaki's avatar Daniel Okazaki Committed by Treehugger Robot
Browse files

FROMGIT: eeprom: at24: fix memory corruption race condition



If the eeprom is not accessible, an nvmem device will be registered, the
read will fail, and the device will be torn down. If another driver
accesses the nvmem device after the teardown, it will reference
invalid memory.

Move the failure point before registering the nvmem device.

Signed-off-by: default avatarDaniel Okazaki <dtokazaki@google.com>
Fixes: b20eb4c1 ("eeprom: at24: drop unnecessary label")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240422174337.2487142-1-dtokazaki@google.com


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>

Bug: 334954384
(cherry picked from commit f42c9702
https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git/

 at24/for-current)
Change-Id: I3d1205a1db45fd56a6b4b7b2387ba728f18faa6e
Signed-off-by: default avatarDaniel Okazaki <dtokazaki@google.com>
parent c7ccd602
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment