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