Commit 27f58c0
scsi: sg: Avoid sg device teardown race
sg_remove_sfp_usercontext() must not use sg_device_destroy() after calling
scsi_device_put().
sg_device_destroy() is accessing the parent scsi_device request_queue which
will already be set to NULL when the preceding call to scsi_device_put()
removed the last reference to the parent scsi_device.
The resulting NULL pointer exception will then crash the kernel.
Link: https://lore.kernel.org/r/[email protected]
Fixes: db59133 ("scsi: sg: fix blktrace debugfs entries leakage")
Cc: [email protected]
Signed-off-by: Alexander Wetzel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>1 parent f02fe78 commit 27f58c0
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2207 | 2207 | | |
2208 | 2208 | | |
2209 | 2209 | | |
| 2210 | + | |
2210 | 2211 | | |
2211 | 2212 | | |
2212 | 2213 | | |
| |||
2232 | 2233 | | |
2233 | 2234 | | |
2234 | 2235 | | |
2235 | | - | |
| 2236 | + | |
2236 | 2237 | | |
| 2238 | + | |
2237 | 2239 | | |
2238 | 2240 | | |
2239 | 2241 | | |
| |||
0 commit comments