Skip to content
Commit bba3d2da authored by Alexandre Belloni's avatar Alexandre Belloni
Browse files

rtc: nvmem: fix possible use after free



In cas of probe failure, devres may free the memory allocated for
rtc->nvram before devm_rtc_release_device() is called. This leads to
rtc_nvram_unregister using it after being freed which may lead to a crash.

This has been shown to happen after commit 461e557b ("rtc: nvmem: use
devm_nvmem_register()")

Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent e01b5781
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment