]> git.baikalelectronics.ru Git - kernel.git/commit
openvswitch: meter: fix NULL pointer dereference in ovs_meter_cmd_reply_start
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Tue, 14 Nov 2017 20:26:16 +0000 (14:26 -0600)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Nov 2017 05:16:07 +0000 (14:16 +0900)
commit9da0404107ee41f6231415dff2171499ba85a2f6
tree140da6bfc4a9c7a811e20ece6f08131cc04c92c9
parent344c4bbcefb2789d3ccaa98d2d958cc6a69bb30b
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: 525014bedcf0 ("openvswitch: Add meter infrastructure")
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/openvswitch/meter.c