diff options
author | Li Nan <[email protected]> | 2023-05-27 15:22:15 +0800 |
---|---|---|
committer | Song Liu <[email protected]> | 2023-06-13 15:25:42 -0700 |
commit | 34817a2441747b48e444cb0e05d84e14bc9443da (patch) | |
tree | f9ee850efe08a10b3717e6cddd41adfb5d7587f4 /drivers/platform/surface/aggregator/ssh_parser.c | |
parent | 75aa7a1b8f85b03971df1d0f5b1a3a9edf020dff (diff) |
md/raid10: fix null-ptr-deref of mreplace in raid10_sync_request
There are two check of 'mreplace' in raid10_sync_request(). In the first
check, 'need_replace' will be set and 'mreplace' will be used later if
no-Faulty 'mreplace' exists, In the second check, 'mreplace' will be
set to NULL if it is Faulty, but 'need_replace' will not be changed
accordingly. null-ptr-deref occurs if Faulty is set between two check.
Fix it by merging two checks into one. And replace 'need_replace' with
'mreplace' because their values are always the same.
Fixes: ee37d7314a32 ("md/raid10: Fix raid10 replace hang when new added disk faulty")
Signed-off-by: Li Nan <[email protected]>
Reviewed-by: Yu Kuai <[email protected]>
Signed-off-by: Song Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/platform/surface/aggregator/ssh_parser.c')
0 files changed, 0 insertions, 0 deletions