Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1240722

[PATCH tip/core/rcu 4/4] locktorture: Fix module unwind when bad torture_type specified

From "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH tip/core/rcu 4/4] locktorture: Fix module unwind when bad torture_type specified
Date 2015-10-06 18:50 +0200
Message-ID <qgDBa-3mf-45@gated-at.bofh.it> (permalink)
References <qgDB7-3mf-7@gated-at.bofh.it> <qgDB7-3mf-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 kernel/locking/locktorture.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index 32244186f1f2..820852f69858 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -661,11 +661,11 @@ static int __init lock_torture_init(void)
 		for (i = 0; i < ARRAY_SIZE(torture_ops); i++)
 			pr_alert(" %s", torture_ops[i]->name);
 		pr_alert("\n");
-		torture_init_end();
-		return -EINVAL;
+		firsterr = -EINVAL;
+		goto unwind;
 	}
 	if (cxt.cur_ops->init)
-		cxt.cur_ops->init(); /* no "goto unwind" prior to this point!!! */
+		cxt.cur_ops->init();
 
 	if (nwriters_stress >= 0)
 		cxt.nrealwriters_stress = nwriters_stress;
-- 
2.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:50 +0200
  [PATCH tip/core/rcu 3/4] torture: Forgive non-plural arguments "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:50 +0200
  [PATCH tip/core/rcu 4/4] locktorture: Fix module unwind when bad torture_type specified "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 18:50 +0200
  [PATCH tip/core/rcu 2/4] rcutorture: Fix unused-function warning for torturing_tasks() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 19:00 +0200
  Re: [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad  torture_type specified Josh Triplett <josh@joshtriplett.org> - 2015-10-06 19:40 +0200
    Re: [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad  torture_type specified "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-06 20:40 +0200

csiph-web