Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dm: NULL check of vq->used in virtio_net_ping_rxq #6121

Merged
merged 1 commit into from Jun 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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>
  • Loading branch information
ssqre committed Jun 1, 2021
commit 131116b15b0e35a62085d23686b43ed1c12c1331
4 changes: 3 additions & 1 deletion devicemodel/hw/pci/virtio/virtio_net.c
Expand Up @@ -490,7 +490,9 @@ virtio_net_ping_rxq(void *vdev, struct virtio_vq_info *vq)
*/
if (net->rx_ready == 0) {
net->rx_ready = 1;
vq->used->flags |= VRING_USED_F_NO_NOTIFY;
if (vq->used != NULL) {
vq->used->flags |= VRING_USED_F_NO_NOTIFY;
}
}
}

Expand Down