[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 05/19] virtio-net: use g_memdup2() instead of unsafe g_mem
From: |
Eugenio Pérez |
Subject: |
[RFC PATCH v3 05/19] virtio-net: use g_memdup2() instead of unsafe g_memdup() |
Date: |
Wed, 30 Mar 2022 20:31:02 +0200 |
Fixing that literal checkpatch.pl because it will complain when we modify the
file
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
hw/net/virtio-net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 1067e72b39..da05516a99 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1443,7 +1443,7 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev,
VirtQueue *vq)
}
iov_cnt = elem->out_num;
- iov2 = iov = g_memdup(elem->out_sg, sizeof(struct iovec) *
elem->out_num);
+ iov2 = iov = g_memdup2(elem->out_sg, sizeof(struct iovec) *
elem->out_num);
s = iov_to_buf(iov, iov_cnt, 0, &ctrl, sizeof(ctrl));
iov_discard_front(&iov, &iov_cnt, sizeof(ctrl));
if (s != sizeof(ctrl)) {
--
2.27.0
- [RFC PATCH v3 00/19] Net Control VQ support with asid in vDPA SVQ, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 01/19] util: Return void on iova_tree_remove, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 03/19] vhost: move descriptor translation to vhost_svq_vring_write_descs, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 06/19] virtio-net: Expose ctrl virtqueue logic, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 05/19] virtio-net: use g_memdup2() instead of unsafe g_memdup(),
Eugenio Pérez <=
- [RFC PATCH v3 04/19] vdpa: Fix index calculus at vhost_vdpa_svqs_start, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 02/19] vdpa: Add x-svq to NetdevVhostVDPAOptions, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 07/19] vdpa: Extract get geatures part from vhost_vdpa_get_max_queue_pairs, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 08/19] virtio: Make virtqueue_alloc_element non-static, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 09/19] vhost: Add SVQElement, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 10/19] vhost: Add custom used buffer callback, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 11/19] vdpa: control virtqueue support on shadow virtqueue, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 12/19] vhost: Add vhost_iova_tree_find, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 15/19] vdpa: add NetClientState->start() callback, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 14/19] vhost: Add vhost_svq_inject, Eugenio Pérez, 2022/03/30