[PATCH] net/sched: fix pointer check in gen_handle

Subsystems: networking [general], tc subsystem, the rest

STALE3282d

3 messages, 3 authors, 2017-09-11 · open the first message on its own page

[PATCH] net/sched: fix pointer check in gen_handle

From: Josh Hunt <hidden>
Date: 2017-09-10 19:49:10

Fixes sparse warning about pointer in gen_handle:
net/sched/cls_rsvp.h:392:40: warning: Using plain integer as NULL pointer

Fixes: 8113c095672f6 ("net_sched: use void pointer for filter handle")
Signed-off-by: Josh Hunt <redacted>
---
 net/sched/cls_rsvp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h
index 98c05db85bcb..b1f6ed48bc72 100644
--- a/net/sched/cls_rsvp.h
+++ b/net/sched/cls_rsvp.h
@@ -389,7 +389,7 @@ static unsigned int gen_handle(struct tcf_proto *tp, unsigned salt)
 		if ((data->hgenerator += 0x10000) == 0)
 			data->hgenerator = 0x10000;
 		h = data->hgenerator|salt;
-		if (rsvp_get(tp, h) == 0)
+		if (!rsvp_get(tp, h))
 			return h;
 	}
 	return 0;
-- 
1.9.1

Re: [PATCH] net/sched: fix pointer check in gen_handle

From: Cong Wang <hidden>
Date: 2017-09-11 18:06:16

On Sun, Sep 10, 2017 at 12:48 PM, Josh Hunt [off-list ref] wrote:
Fixes sparse warning about pointer in gen_handle:
net/sched/cls_rsvp.h:392:40: warning: Using plain integer as NULL pointer

Fixes: 8113c095672f6 ("net_sched: use void pointer for filter handle")
Signed-off-by: Josh Hunt <redacted>
Acked-by: Cong Wang <redacted>

Re: [PATCH] net/sched: fix pointer check in gen_handle

From: David Miller <davem@davemloft.net>
Date: 2017-09-11 21:35:03

From: Josh Hunt <redacted>
Date: Sun, 10 Sep 2017 15:48:50 -0400
Fixes sparse warning about pointer in gen_handle:
net/sched/cls_rsvp.h:392:40: warning: Using plain integer as NULL pointer

Fixes: 8113c095672f6 ("net_sched: use void pointer for filter handle")
Signed-off-by: Josh Hunt <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help