Commit 825711e
md/raid10: fix null ptr dereference in raid10_size()
In raid10_run() if raid10_set_queue_limits() succeed, the return value
is set to zero, and if following procedures failed raid10_run() will
return zero while mddev->private is still NULL, causing null ptr
dereference in raid10_size().
Fix the problem by only overwrite the return value if
raid10_set_queue_limits() failed.
Fixes: 3d8466b ("md/raid10: use the atomic queue limit update APIs")
Cc: [email protected]
Reported-and-tested-by: ValdikSS <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Yu Kuai <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Song Liu <[email protected]>1 parent 62ce078 commit 825711e
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4061 | 4061 | | |
4062 | 4062 | | |
4063 | 4063 | | |
4064 | | - | |
4065 | | - | |
| 4064 | + | |
| 4065 | + | |
| 4066 | + | |
| 4067 | + | |
4066 | 4068 | | |
| 4069 | + | |
4067 | 4070 | | |
4068 | 4071 | | |
4069 | 4072 | | |
| |||
0 commit comments