mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 23:21:46 +00:00
locktorture: Fix module unwind when bad torture_type specified
The locktorture module has a list of torture types, and specifying a type not on this list is supposed to cleanly fail the module load. Unfortunately, the "fail" happens without the "cleanly". This commit therefore adds the needed clean-up after an incorrect torture_type. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
This commit is contained in:
parent
a8c06024d0
commit
a36a99618b
1 changed files with 3 additions and 3 deletions
|
@ -661,11 +661,11 @@ static int __init lock_torture_init(void)
|
||||||
for (i = 0; i < ARRAY_SIZE(torture_ops); i++)
|
for (i = 0; i < ARRAY_SIZE(torture_ops); i++)
|
||||||
pr_alert(" %s", torture_ops[i]->name);
|
pr_alert(" %s", torture_ops[i]->name);
|
||||||
pr_alert("\n");
|
pr_alert("\n");
|
||||||
torture_init_end();
|
firsterr = -EINVAL;
|
||||||
return -EINVAL;
|
goto unwind;
|
||||||
}
|
}
|
||||||
if (cxt.cur_ops->init)
|
if (cxt.cur_ops->init)
|
||||||
cxt.cur_ops->init(); /* no "goto unwind" prior to this point!!! */
|
cxt.cur_ops->init();
|
||||||
|
|
||||||
if (nwriters_stress >= 0)
|
if (nwriters_stress >= 0)
|
||||||
cxt.nrealwriters_stress = nwriters_stress;
|
cxt.nrealwriters_stress = nwriters_stress;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue