netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/sched: fix pointer check in gen_handle
@ 2017-09-10 19:48 Josh Hunt
  2017-09-11 18:05 ` Cong Wang
  2017-09-11 21:35 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Josh Hunt @ 2017-09-10 19:48 UTC (permalink / raw)
  To: davem, jhs, xiyou.wangcong, jiri; +Cc: netdev, Josh Hunt

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 <johunt@akamai.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-11 21:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-10 19:48 [PATCH] net/sched: fix pointer check in gen_handle Josh Hunt
2017-09-11 18:05 ` Cong Wang
2017-09-11 21:35 ` David Miller

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).