net/virtio: fix incorrect cast
authorDidier Pallard <didier.pallard@6wind.com>
Thu, 14 Dec 2017 14:33:43 +0000 (15:33 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
commit43ec842ca45d1b090998aff20c64eb92cc8bdf0b
treef6bfe8b484bada88f24d77e63a0347fcf2e6a71f
parentee1bc7d0dc6cff4396f2b72faab3c15cd3879407
net/virtio: fix incorrect cast

The rx_queues and tx_queues fields of the data structure points to a
struct virtnet_rx or virtnet_tx. Casting it to a virtqueue is an error.

It does not trigger any bug because pointer is not dereferenced inside
the function, but it can become a bug if this code is copy/pasted and
vq is dereferenced.

Fixes: 01ad44fd374f ("net/virtio: split Rx/Tx queue")
Cc: stable@dpdk.org
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
drivers/net/virtio/virtio_ethdev.c