openvswitch: Use IS_ERR instead of IS_ERR_OR_NULL
authorYueHaibing <yuehaibing@huawei.com>
Sat, 31 Oct 2020 06:01:53 +0000 (14:01 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Nov 2020 01:34:26 +0000 (17:34 -0800)
Fix smatch warning:

net/openvswitch/meter.c:427 ovs_meter_cmd_set() warn: passing zero to 'PTR_ERR'

dp_meter_create() never returns NULL, use IS_ERR
instead of IS_ERR_OR_NULL to fix this.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Link: https://lore.kernel.org/r/20201031060153.39912-1-yuehaibing@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/openvswitch/meter.c

index 8fbefd5..15424d2 100644 (file)
@@ -423,7 +423,7 @@ static int ovs_meter_cmd_set(struct sk_buff *skb, struct genl_info *info)
                return -EINVAL;
 
        meter = dp_meter_create(a);
-       if (IS_ERR_OR_NULL(meter))
+       if (IS_ERR(meter))
                return PTR_ERR(meter);
 
        reply = ovs_meter_cmd_reply_start(info, OVS_METER_CMD_SET,