diff options
author | NeilBrown <neilb@suse.com> | 2016-12-05 06:40:50 +0100 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-12-06 02:11:03 +0100 |
commit | e2342ca832726a840ca6bd196dd2cc073815b08a (patch) | |
tree | 580eb7ef4129964a221c3e802700cf259c0b8dce /drivers/regulator/max8997-regulator.c | |
parent | md/r5cache: do r5c_update_log_state after log recovery (diff) | |
download | linux-e2342ca832726a840ca6bd196dd2cc073815b08a.tar.xz linux-e2342ca832726a840ca6bd196dd2cc073815b08a.zip |
md: fix refcount problem on mddev when stopping array.
md_open() gets a counted reference on an mddev using mddev_find().
If it ends up returning an error, it must drop this reference.
There are two error paths where the reference is not dropped.
One only happens if the process is signalled and an awkward time,
which is quite unlikely.
The other was introduced recently in commit af8d8e6f0.
Change the code to ensure the drop the reference when returning an error,
and make it harded to re-introduce this sort of bug in the future.
Reported-by: Marc Smith <marc.smith@mcc.edu>
Fixes: af8d8e6f0315 ("md: changes for MD_STILL_CLOSED flag")
Signed-off-by: NeilBrown <neilb@suse.com>
Acked-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/regulator/max8997-regulator.c')
0 files changed, 0 insertions, 0 deletions