Commit 12b4c19
cdrom: Call cdrom_mrw_exit from cdrom_release function
Remove the cdrom_mrw_exit call from unregister_cdrom, as it invokes
block commands that can fail due to a NULL pointer dereference from the
call happening too late, during the unloading of the driver (e.g.
unplugging of USB optical drives).
Instead perform the call inside cdrom_release, thus also removing the
need for the exit function pointer inside the cdrom_device_info struct.
Reported-by: Sergey Senozhatsky <[email protected]>
Closes: https://lore.kernel.org/linux-block/uxgzea5ibqxygv3x7i4ojbpvcpv2wziorvb3ns5cdtyvobyn7h@y4g4l5ezv2ec
Suggested-by: Jens Axboe <[email protected]>
Link: https://lore.kernel.org/linux-block/[email protected]
Tested-by: Phillip Potter <[email protected]>
Signed-off-by: Phillip Potter <[email protected]>1 parent 81f31a4 commit 12b4c19
3 files changed
Lines changed: 2 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
277 | 276 | | |
278 | 277 | | |
279 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | 627 | | |
631 | 628 | | |
632 | 629 | | |
| |||
651 | 648 | | |
652 | 649 | | |
653 | 650 | | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | 651 | | |
658 | 652 | | |
659 | 653 | | |
| |||
1264 | 1258 | | |
1265 | 1259 | | |
1266 | 1260 | | |
| 1261 | + | |
| 1262 | + | |
1267 | 1263 | | |
1268 | 1264 | | |
1269 | 1265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
| |||
0 commit comments