mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
PTR_ERR should be called before its argument is cleared.
The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e,e1; constant c; @@ *e = c ... when != e = e1 when != &e when != true IS_ERR(e) *PTR_ERR(e) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Reported-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
This commit is contained in:
parent
bde23c6892
commit
3c1b1ce00d
1 changed files with 4 additions and 1 deletions
|
@ -1465,12 +1465,15 @@ rcu_torture_onoff(void *arg)
|
||||||
static int __cpuinit
|
static int __cpuinit
|
||||||
rcu_torture_onoff_init(void)
|
rcu_torture_onoff_init(void)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (onoff_interval <= 0)
|
if (onoff_interval <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
onoff_task = kthread_run(rcu_torture_onoff, NULL, "rcu_torture_onoff");
|
onoff_task = kthread_run(rcu_torture_onoff, NULL, "rcu_torture_onoff");
|
||||||
if (IS_ERR(onoff_task)) {
|
if (IS_ERR(onoff_task)) {
|
||||||
|
ret = PTR_ERR(onoff_task);
|
||||||
onoff_task = NULL;
|
onoff_task = NULL;
|
||||||
return PTR_ERR(onoff_task);
|
return ret;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue