dm: NULL check of vq->used in virtio_net_ping_rxq

Add a check on this place to avoid NULL access issue.

Tracked-On: #6100
Signed-off-by: Jie Deng <jie.deng@intel.com>
This commit is contained in:
Jie Deng 2021-05-24 13:57:49 +08:00 committed by wenlingz
parent 21915dfd52
commit 81c5bdab5f

View File

@ -490,9 +490,11 @@ virtio_net_ping_rxq(void *vdev, struct virtio_vq_info *vq)
*/
if (net->rx_ready == 0) {
net->rx_ready = 1;
if (vq->used != NULL) {
vq->used->flags |= VRING_USED_F_NO_NOTIFY;
}
}
}
static void
virtio_net_proctx(struct virtio_net *net, struct virtio_vq_info *vq)