diff options
| author | Joshua Mulloy <joshuamulloy@gmail.com> | 2026-10-04 06:28:48 -0400 |
|---|---|---|
| committer | Ulf Hansson <ulfh@kernel.org> | 2026-11-05 18:56:25 +0100 |
| commit | 6f2b998a52746892968741cbf8fc226985cbf286 (patch) | |
| tree | 25990706cd5dcf26ede9d74884d25675961e3025 /include/linux/timerqueue.h | |
| parent | c931c51681e33b24bc8d65c6df35b70e1827daa2 (diff) | |
memstick: core: don't clear dev->driver in memstick_device_remove()
memstick_device_remove() sets card->dev.driver to NULL after calling the
driver's remove() callback. Since commit a995fe1a3aa7 ("rust: driver:
drop device private data post unbind"), device_unbind_cleanup()
dereferences dev->driver after the bus remove() callback has returned,
so this should result in a NULL pointer dereference whenever a
MemoryStick card is removed or its driver is unbound.
The driver core clears dev->driver itself in device_unbind_cleanup(), so
there is no need for the bus code to do it. Remove the assignment.
This was found by code inspection, with the help of an AI coding
assistant, after hitting the same bug in the TI FlashMedia bus code
(drivers/misc/tifm_core.c), which oopsed on SD card removal. It has
only been compile-tested: no MemoryStick hardware was available.
Fixes: a995fe1a3aa7 ("rust: driver: drop device private data post unbind")
Cc: stable@vger.kernel.org
Signed-off-by: Joshua Mulloy <joshuamulloy@gmail.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions
