Skip to content

Commit b74912a

Browse files
GustavoARSilvadavem330
authored andcommitted
openvswitch: meter: fix NULL pointer dereference in ovs_meter_cmd_reply_start
It seems that the intention of the code is to null check the value returned by function genlmsg_put. But the current code is null checking the address of the pointer that holds the value returned by genlmsg_put. Fix this by properly null checking the value returned by function genlmsg_put in order to avoid a pontential null pointer dereference. Addresses-Coverity-ID: 1461561 ("Dereference before null check") Addresses-Coverity-ID: 1461562 ("Dereference null return value") Fixes: 96fbc13 ("openvswitch: Add meter infrastructure") Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 69d4817 commit b74912a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/openvswitch/meter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ ovs_meter_cmd_reply_start(struct genl_info *info, u8 cmd,
9999
*ovs_reply_header = genlmsg_put(skb, info->snd_portid,
100100
info->snd_seq,
101101
&dp_meter_genl_family, 0, cmd);
102-
if (!ovs_reply_header) {
102+
if (!*ovs_reply_header) {
103103
nlmsg_free(skb);
104104
return ERR_PTR(-EMSGSIZE);
105105
}

0 commit comments

Comments
 (0)