[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 04/18] virtio-net: use g_memdup2() instead of unsafe g_mem
From: |
Eugenio Pérez |
Subject: |
[RFC PATCH v2 04/18] virtio-net: use g_memdup2() instead of unsafe g_memdup() |
Date: |
Thu, 17 Mar 2022 19:23:45 +0100 |
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 2087516253..cb505939b2 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 v2 00/18] Net Control VQ support with asid in vDPA SVQ, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 01/18] vdpa: Add x-svq to NetdevVhostVDPAOptions, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 05/18] virtio-net: Expose ctrl virtqueue logic, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 02/18] vhost: move descriptor translation to vhost_svq_vring_write_descs, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 03/18] vdpa: Fix index calculus at vhost_vdpa_svqs_start, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 04/18] virtio-net: use g_memdup2() instead of unsafe g_memdup(),
Eugenio Pérez <=
- [RFC PATCH v2 06/18] vdpa: Extract get geatures part from vhost_vdpa_get_max_queue_pairs, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 07/18] virtio: Make virtqueue_alloc_element non-static, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 08/18] vhost: Add SVQElement, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 09/18] vhost: Add custom used buffer callback, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 10/18] vdpa: control virtqueue support on shadow virtqueue, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 11/18] vhost: Add vhost_iova_tree_find, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 12/18] vdpa: Add map/unmap operation callback to SVQ, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 13/18] vhost: Add vhost_svq_inject, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 14/18] vdpa: add NetClientState->start() callback, Eugenio Pérez, 2022/03/17
- [RFC PATCH v2 15/18] vdpa: Add vhost_vdpa_start_control_svq, Eugenio Pérez, 2022/03/17