lkml.org 
[lkml]   [2023]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: sched: Fix an endian bug in tcf_proto_create
From
On 17/11/2023 06:31, Kunwu Chan wrote:
> net/sched/cls_api.c:390:22: warning: incorrect type in assignment (different base types)
> net/sched/cls_api.c:390:22: expected restricted __be16 [usertype] protocol
> net/sched/cls_api.c:390:22: got unsigned int [usertype] protocol
>
> Fixes: 33a48927c193 ("sched: push TC filter protocol creation into a separate function")
>
> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
> ---
> net/sched/cls_api.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> index 1976bd163986..f73f39f61f66 100644
> --- a/net/sched/cls_api.c
> +++ b/net/sched/cls_api.c
> @@ -387,7 +387,7 @@ static struct tcf_proto *tcf_proto_create(const char *kind, u32 protocol,
> goto errout;
> }
> tp->classify = tp->ops->classify;
> - tp->protocol = protocol;
> + tp->protocol = cpu_to_be16(protocol);
> tp->prio = prio;
> tp->chain = chain;
> spin_lock_init(&tp->lock);
I don't believe there's something to fix here either

\
 
 \ /
  Last update: 2023-11-20 14:02    [W:0.077 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site