On Wed, Apr 23, 2025 at 10:17:16AM +0300, Dan Carpenter wrote:
> Hello Joel Fernandes,
>
> Commit bd57ec707441 ("rcutorture: Perform more frequent testing of
> ->gpwrap") from Feb 16, 2025 (linux-next), leads to the following
> Smatch static checker warning:
>
> kernel/rcu/rcutorture.c:4586 rcu_torture_init()
> warn: missing error code 'firsterr'
>
> kernel/rcu/rcutorture.c
> 4576 if (torture_init_error(firsterr))
> 4577 goto unwind;
> 4578 }
> 4579 if (object_debug)
> 4580 rcu_test_debug_objects();
> 4581 torture_init_end();
^^^^^^^^^^^^^^^^^^^
Also:
kernel/rcu/rcutorture.c:4591 rcu_torture_init() warn: double unlock 'global
&fullstop_mutex' (orig line 4581)
> 4582 if (cur_ops->gp_slow_register &&
> !WARN_ON_ONCE(!cur_ops->gp_slow_unregister))
> 4583 cur_ops->gp_slow_register(&rcu_fwd_cb_nodelay);
> 4584
> 4585 if (cur_ops->set_gpwrap_lag && rcu_gpwrap_lag_init())
> --> 4586 goto unwind;
>
> set an error code?
>
> 4587
> 4588 return 0;
> 4589
> 4590 unwind:
> 4591 torture_init_end();
^^^^^^^^^^^^^^^^^^^
regards,
dan carpenter
> 4592 rcu_torture_cleanup();
> 4593 if (shutdown_secs) {
> 4594 WARN_ON(!IS_MODULE(CONFIG_RCU_TORTURE_TEST));
> 4595 kernel_power_off();
> 4596 }
> 4597 return firsterr;
> 4598 }
>
> regards,
> dan carpenter