Commit 80f3e8c
spi: fix use-after-free on controller registration failure
commit 8634e05 upstream.
Make sure to deregister from driver core also in the unlikely event that
per-cpu statistics allocation fails during controller registration to
avoid use-after-free (of driver resources) and unclocked register
accesses.
Fixes: 6598b91 ("spi: spi.c: Convert statistics to per-cpu u64_stats_t")
Cc: stable@vger.kernel.org # 6.0
Cc: David Jander <david@protonic.nl>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260312151817.32100-2-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 18605b1 commit 80f3e8c
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3344 | 3344 | | |
3345 | 3345 | | |
3346 | 3346 | | |
3347 | | - | |
3348 | | - | |
3349 | | - | |
3350 | | - | |
| 3347 | + | |
| 3348 | + | |
3351 | 3349 | | |
3352 | 3350 | | |
3353 | 3351 | | |
| |||
3370 | 3368 | | |
3371 | 3369 | | |
3372 | 3370 | | |
| 3371 | + | |
| 3372 | + | |
3373 | 3373 | | |
3374 | 3374 | | |
3375 | 3375 | | |
| |||
0 commit comments