virtio: coverity woes -- divide by zero 73/34973/3
authorSteven Luong <sluong@cisco.com>
Wed, 19 Jan 2022 17:08:27 +0000 (09:08 -0800)
committerBeno�t Ganne <bganne@cisco.com>
Tue, 1 Feb 2022 16:33:26 +0000 (16:33 +0000)
commitc4a48f2c397e6ec219ed64be65a1cc23847f595a
treeb98e96bb1925263c7fcad239bcb61499d7a40481
parent0a214804f873747548d022d44d21e5a43ad997b3
virtio: coverity woes -- divide by zero

Coverity complains the expression, j % vif->num_txq, may encounter
divide by zero. While there is little chance that vif->num_txq is
zero, it is easy to prevent divide by zero if vif->num_txq is ever
zero.

Type: fix
Fixes: I337ec63d0868f665329d68eadf1744e080b73a0d

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I2e91f296737ce266ab70fffc1f442cc600724fa2
src/vnet/devices/virtio/virtio.c