[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4cbd35c1bb2dd8b0a8bea85d32e3d296fac5f715.camel@redhat.com>
Date: Thu, 24 Aug 2023 16:41:45 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Jamal Hadi Salim <jhs@...atatu.com>, Dan Carpenter
<dan.carpenter@...aro.org>
Cc: Simon Horman <horms@...nel.org>, Linux Kernel Network Developers
<netdev@...r.kernel.org>
Subject: Re: Weird sparse error WAS( [PATCH net-next v2 3/3] net/sched:
act_blockcast: Introduce blockcast tc action
On Thu, 2023-08-24 at 10:30 -0400, Jamal Hadi Salim wrote:
> Dan/Simon,
> Can someone help explain this error on the code below:
>
> ../net/sched/act_blockcast.c:213:9: warning: context imbalance in
> 'tcf_blockcast_init' - different lock contexts for basic block
IIRC sparse is fooled by lock under conditionals, in this case:
if (exists)
spin_lock_bh(&p->tcf_lock);
a possible solution would be:
if (exists) {
spin_lock_bh(&p->tcf_lock);
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
spin_unlock_bh(&p->tcf_lock);
} else {
goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch);
}
Using some additional helpers the code could be less ugly...
Cheers,
Paolo
Powered by blists - more mailing lists