net/virtio: fix crash on null dereference
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 19 Jul 2016 02:39:53 +0000 (10:39 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 21 Jul 2016 22:30:08 +0000 (00:30 +0200)
commit834ac655bae247acee5016dc46400f456db047fd
tree6c90c9a3f65992b1fc5b5a0225a034687e21e738
parent25f80d1087809b6efedc85923310f571aae2668f
net/virtio: fix crash on null dereference

The rxq/txq for the queue_release callback could be NULL, say when
rte_eth_dev_configure() fails that the queue is not setup at all.

Do a simple NULL check would fix the crash issue.

Fixes: 01ad44fd374f ("net/virtio: split Rx/Tx queue")

Reported-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/virtio/virtio_rxtx.c