From: Wei Yongjun Date: Tue, 14 Nov 2017 06:20:16 +0000 (+0000) Subject: openvswitch: Fix return value check in ovs_meter_cmd_features() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8a860c2bcc84a8e4fbcabb928cd97e4c51b17d93;p=linux.git openvswitch: Fix return value check in ovs_meter_cmd_features() In case of error, the function ovs_meter_cmd_reply_start() returns ERR_PTR() not NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 96fbc13d7e77 ("openvswitch: Add meter infrastructure") Signed-off-by: Wei Yongjun Acked-by: Pravin B Shelar Signed-off-by: David S. Miller --- diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c index 2a5ba356c4720..2e58b6c4c65f4 100644 --- a/net/openvswitch/meter.c +++ b/net/openvswitch/meter.c @@ -166,7 +166,7 @@ static int ovs_meter_cmd_features(struct sk_buff *skb, struct genl_info *info) reply = ovs_meter_cmd_reply_start(info, OVS_METER_CMD_FEATURES, &ovs_reply_header); - if (!reply) + if (IS_ERR(reply)) return PTR_ERR(reply); if (nla_put_u32(reply, OVS_METER_ATTR_MAX_METERS, U32_MAX) ||