Skip to content

Commit

Permalink
openvswitch: Fix return value check in ovs_meter_cmd_features()
Browse files Browse the repository at this point in the history
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: 96fbc13 ("openvswitch: Add meter infrastructure")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Nov 14, 2017
1 parent 228aa01 commit 8a860c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/openvswitch/meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down

0 comments on commit 8a860c2

Please sign in to comment.