[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6f362a9d-a87e-4061-bf41-14810e432333@amd.com>
Date: Wed, 13 Nov 2024 22:30:28 +0530
From: Neeraj Upadhyay <Neeraj.Upadhyay@....com>
To: "Uladzislau Rezki (Sony)" <urezki@...il.com>,
Frederic Weisbecker <frederic@...nel.org>
Cc: "Paul E . McKenney" <paulmck@...nel.org>, RCU <rcu@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>, Boqun Feng <boqun.feng@...il.com>,
Joel Fernandes <joel@...lfernandes.org>,
Oleksiy Avramchenko <oleksiy.avramchenko@...y.com>,
Dan Carpenter <dan.carpenter@...aro.org>
Subject: Re: [PATCH v2 1/2] rcuscale: Do a proper cleanup if
kfree_scale_init() fails
On 11/13/2024 4:30 PM, Uladzislau Rezki (Sony) wrote:
> A static analyzer for C, Smatch, reports and triggers below
> warnings:
>
> kernel/rcu/rcuscale.c:1215 rcu_scale_init()
> warn: inconsistent returns 'global &fullstop_mutex'.
>
> The checker complains about, we do not unlock the "fullstop_mutex"
> mutex, in case of hitting below error path:
>
> <snip>
> ...
> if (WARN_ON_ONCE(jiffies_at_lazy_cb - jif_start < 2 * HZ)) {
> pr_alert("ERROR: call_rcu() CBs are not being lazy as expected!\n");
> WARN_ON_ONCE(1);
> return -1;
> ^^^^^^^^^^
> ...
> <snip>
>
> it happens because "-1" is returned right away instead of
> doing a proper unwinding.
>
> Fix it by jumping to "unwind" label instead of returning -1.
>
> Reviewed-by: Paul E. McKenney <paulmck@...nel.org>
> Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
> Closes: https://lore.kernel.org/rcu/ZxfTrHuEGtgnOYWp@pc636/T/
> Fixes: 084e04fff160 ("rcuscale: Add laziness and kfree tests")
> Signed-off-by: Uladzislau Rezki (Sony) <urezki@...il.com>
> ---
Reviewed-by: Neeraj Upadhyay <Neeraj.Upadhyay@....com>
- Neeraj
Powered by blists - more mailing lists