Commit fed13a5
Mikulas Patocka
dm: fix a crash if blk_alloc_disk fails
If blk_alloc_disk fails, the variable md->disk is set to an error value.
cleanup_mapped_device will see that md->disk is non-NULL and it will
attempt to access it, causing a crash on this statement
"md->disk->private_data = NULL;".
Signed-off-by: Mikulas Patocka <[email protected]>
Reported-by: Chenyuan Yang <[email protected]>
Closes: https://marc.info/?l=dm-devel&m=172824125004329&w=2
Cc: [email protected]
Reviewed-by: Nitesh Shetty <[email protected]>1 parent 8e929cb commit fed13a5
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2290 | 2290 | | |
2291 | 2291 | | |
2292 | 2292 | | |
2293 | | - | |
| 2293 | + | |
| 2294 | + | |
2294 | 2295 | | |
| 2296 | + | |
2295 | 2297 | | |
2296 | 2298 | | |
2297 | 2299 | | |
| |||
0 commit comments