net/sched: fix pointer check in gen_handle
authorJosh Hunt <johunt@akamai.com>
Sun, 10 Sep 2017 19:48:50 +0000 (15:48 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Sep 2017 21:34:52 +0000 (14:34 -0700)
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>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_rsvp.h

index 98c05db85bcbc6e1bfce099686d7fa88590190b1..b1f6ed48bc729b9238d1a3502c147ca856b3a996 100644 (file)
@@ -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;