* [PATCH] xfrm: Fix incorrect types in assignment
@ 2021-02-19 9:48 Yang Li
2021-02-19 14:02 ` Florian Westphal
0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-02-19 9:48 UTC (permalink / raw)
To: steffen.klassert; +Cc: herbert, davem, kuba, 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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index b74f28c..5c67407 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1225,7 +1225,7 @@ static void xfrm_hash_rebuild(struct work_struct *work)
struct xfrm_policy *pol;
struct xfrm_policy *policy;
struct hlist_head *chain;
- struct hlist_head *odst;
+ struct hlist_head __rcu *odst;
struct hlist_node *newpos;
int i;
int dir;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xfrm: Fix incorrect types in assignment
2021-02-19 9:48 [PATCH] xfrm: Fix incorrect types in assignment Yang Li
@ 2021-02-19 14:02 ` Florian Westphal
0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2021-02-19 14:02 UTC (permalink / raw)
To: Yang Li; +Cc: steffen.klassert, herbert, davem, kuba, netdev, linux-kernel
Yang Li <yang.lee@linux.alibaba.com> 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>
> ---
> net/xfrm/xfrm_policy.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
> index b74f28c..5c67407 100644
> --- a/net/xfrm/xfrm_policy.c
> +++ b/net/xfrm/xfrm_policy.c
> @@ -1225,7 +1225,7 @@ static void xfrm_hash_rebuild(struct work_struct *work)
> struct xfrm_policy *pol;
> struct xfrm_policy *policy;
> struct hlist_head *chain;
> - struct hlist_head *odst;
> + struct hlist_head __rcu *odst;
This doesn't look right. Try something like
- 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));
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-19 14:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-19 9:48 [PATCH] xfrm: Fix incorrect types in assignment Yang Li
2021-02-19 14:02 ` Florian Westphal
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).