* [PATCH v2] xfrm: Fix incorrect types in assignment
@ 2021-02-20 3:18 Yang Li
2021-03-01 11:32 ` Steffen Klassert
0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-02-20 3:18 UTC (permalink / raw)
To: steffen.klassert; +Cc: herbert, davem, kuba, fw, netdev, linux-kernel, Yang Li
Fix the following sparse warnings:
net/xfrm/xfrm_policy.c:1303:22: warning: incorrect type in assignment
(different address spaces)
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
net/xfrm/xfrm_policy.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index b74f28c..aac5e88 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1300,7 +1300,8 @@ static void xfrm_hash_rebuild(struct work_struct *work)
}
hmask = net->xfrm.policy_bydst[dir].hmask;
- odst = net->xfrm.policy_bydst[dir].table;
+ odst = rcu_dereference_protected(net->xfrm.policy_bydst[dir].table,
+ lockdep_is_held(&net->xfrm.xfrm_policy_lock));
for (i = hmask; i >= 0; i--) {
hlist_for_each_entry_safe(policy, n, odst + i, bydst)
hlist_del_rcu(&policy->bydst);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] xfrm: Fix incorrect types in assignment
2021-02-20 3:18 [PATCH v2] xfrm: Fix incorrect types in assignment Yang Li
@ 2021-03-01 11:32 ` Steffen Klassert
0 siblings, 0 replies; 2+ messages in thread
From: Steffen Klassert @ 2021-03-01 11:32 UTC (permalink / raw)
To: Yang Li; +Cc: herbert, davem, kuba, fw, netdev, linux-kernel
On Sat, Feb 20, 2021 at 11:18:23AM +0800, Yang Li wrote:
> Fix the following sparse warnings:
> net/xfrm/xfrm_policy.c:1303:22: warning: incorrect type in assignment
> (different address spaces)
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Please add a proper 'Fixes' tag so that it can be backported into
the stable trees.
Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-01 11:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-20 3:18 [PATCH v2] xfrm: Fix incorrect types in assignment Yang Li
2021-03-01 11:32 ` Steffen Klassert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).