Displaying 20 results from an estimated 375 matches for "kmalloc_array".
2017 Aug 03
1
[PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
.../2017 04:13 PM, Pankaj Gupta wrote:
> >>
> >> + /* Allocate space for find_vqs parameters */
> >> + vqs = kcalloc(nvqs, sizeof(*vqs), GFP_KERNEL);
> >> + if (!vqs)
> >> + goto err_vq;
> >> + callbacks = kmalloc_array(nvqs, sizeof(*callbacks), GFP_KERNEL);
> >> + if (!callbacks)
> >> + goto err_callback;
> >> + names = kmalloc_array(nvqs, sizeof(*names), GFP_KERNEL);
> >
> > is size here (integer) intentional?
>...
2017 Aug 03
1
[PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
.../2017 04:13 PM, Pankaj Gupta wrote:
> >>
> >> + /* Allocate space for find_vqs parameters */
> >> + vqs = kcalloc(nvqs, sizeof(*vqs), GFP_KERNEL);
> >> + if (!vqs)
> >> + goto err_vq;
> >> + callbacks = kmalloc_array(nvqs, sizeof(*callbacks), GFP_KERNEL);
> >> + if (!callbacks)
> >> + goto err_callback;
> >> + names = kmalloc_array(nvqs, sizeof(*names), GFP_KERNEL);
> >
> > is size here (integer) intentional?
>...
2016 Sep 21
0
[PATCH 2/5] GPU-DRM-nouveau: Use kmalloc_array() in gt215_link_train()
From: Markus Elfring <elfring at users.sourceforge.net>
Date: Tue, 20 Sep 2016 22:32:14 +0200
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".
This issue was detected by using the Coccinelle software.
* Replace the specification of a data type by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring at users.s...
2017 Jan 26
0
[PATCH 2/3] virtio_pci: Use kmalloc_array() in vp_request_msix_vectors()
From: Markus Elfring <elfring at users.sourceforge.net>
Date: Thu, 26 Jan 2017 22:20:30 +0100
A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus reuse the corresponding function "kmalloc_array".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring at users.sourceforge.net>
---
drivers/virtio/virtio_pci_common.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/vi...
2017 Jan 26
0
[PATCH 3/3] virtio_ring: Use kmalloc_array() in alloc_indirect()
From: Markus Elfring <elfring at users.sourceforge.net>
Date: Thu, 26 Jan 2017 22:30:45 +0100
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kmalloc_array".
This issue was detected by using the Coccinelle software.
* Replace the specification of a data structure by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring at us...
2018 Jul 25
0
[PATCH 2/2] tools/virtio: add kmalloc_array stub
Fixes: 6da2ec56059 ("treewide: kmalloc() -> kmalloc_array()")
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
tools/virtio/linux/kernel.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h
index fca8381bbe04..fb22bccfbc8a 100644
--- a/tools/virtio/linux/kernel.h
+++ b/to...
2017 Jan 26
4
[PATCH 0/3] Virtio: Fine-tuning for two function implementations
From: Markus Elfring <elfring at users.sourceforge.net>
Date: Thu, 26 Jan 2017 22:40:02 +0100
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
virtio_pci: Use kcalloc() in vp_request_msix_vectors()
virtio_pci: Use kmalloc_array() in vp_request_msix_vectors()
virtio_ring: Use kmalloc_array() in alloc_indirect()
drivers/virtio/virtio_pci_common.c | 8 ++++----
drivers/virtio/virtio_ring.c | 3 +--
2 files changed, 5 insertions(+), 6 deletions(-)
--
2.11.0
2017 Jan 26
4
[PATCH 0/3] Virtio: Fine-tuning for two function implementations
From: Markus Elfring <elfring at users.sourceforge.net>
Date: Thu, 26 Jan 2017 22:40:02 +0100
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
virtio_pci: Use kcalloc() in vp_request_msix_vectors()
virtio_pci: Use kmalloc_array() in vp_request_msix_vectors()
virtio_ring: Use kmalloc_array() in alloc_indirect()
drivers/virtio/virtio_pci_common.c | 8 ++++----
drivers/virtio/virtio_ring.c | 3 +--
2 files changed, 5 insertions(+), 6 deletions(-)
--
2.11.0
2016 Oct 03
0
[PATCH 1/4] virtio_blk: Use kmalloc_array() in init_vq()
...ote:
> From: Markus Elfring <elfring at users.sourceforge.net>
> Date: Tue, 13 Sep 2016 11:32:22 +0200
>
> Multiplications for the size determination of memory allocations
> indicated that array data structures should be processed.
> Thus use the corresponding function "kmalloc_array".
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring at users.sourceforge.net>
> ---
> drivers/block/virtio_blk.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Stefan Hajnoczi <...
2016 Oct 03
0
[PATCH 1/4] virtio_blk: Use kmalloc_array() in init_vq()
...ote:
> From: Markus Elfring <elfring at users.sourceforge.net>
> Date: Tue, 13 Sep 2016 11:32:22 +0200
>
> Multiplications for the size determination of memory allocations
> indicated that array data structures should be processed.
> Thus use the corresponding function "kmalloc_array".
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring at users.sourceforge.net>
> ---
> drivers/block/virtio_blk.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Stefan Hajnoczi <...
2017 Aug 03
2
[PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
..._has_feature(vb->vdev, VIRTIO_BALLOON_F_FREE_PAGE_VQ))
> + nvqs++;
> +
> + /* Allocate space for find_vqs parameters */
> + vqs = kcalloc(nvqs, sizeof(*vqs), GFP_KERNEL);
> + if (!vqs)
> + goto err_vq;
> + callbacks = kmalloc_array(nvqs, sizeof(*callbacks), GFP_KERNEL);
> + if (!callbacks)
> + goto err_callback;
> + names = kmalloc_array(nvqs, sizeof(*names), GFP_KERNEL);
is size here (integer) intentional?
> + if (!names)
> + goto...
2017 Aug 03
2
[PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
..._has_feature(vb->vdev, VIRTIO_BALLOON_F_FREE_PAGE_VQ))
> + nvqs++;
> +
> + /* Allocate space for find_vqs parameters */
> + vqs = kcalloc(nvqs, sizeof(*vqs), GFP_KERNEL);
> + if (!vqs)
> + goto err_vq;
> + callbacks = kmalloc_array(nvqs, sizeof(*callbacks), GFP_KERNEL);
> + if (!callbacks)
> + goto err_callback;
> + names = kmalloc_array(nvqs, sizeof(*names), GFP_KERNEL);
is size here (integer) intentional?
> + if (!names)
> + goto...
2016 Sep 21
8
[PATCH 0/5] GPU-DRM-nouveau: Fine-tuning for five function implementations
From: Markus Elfring <elfring at users.sourceforge.net>
Date: Wed, 21 Sep 2016 09:09:09 +0200
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (5):
Use kmalloc_array() in nvbios_iccsense_parse()
Use kmalloc_array() in gt215_link_train()
Delete unnecessary braces
Adjust a kzalloc() call in gt215_ram_new()
Add space after an "if"
drivers/gpu/drm/nouveau/nvkm/subdev/bios/iccsense.c | 4 +++-
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c...
2019 Oct 14
1
[PATCH V3 6/7] virtio: introduce a mdev based transport
...; + struct virtio_mdev_device *vm_dev = to_virtio_mdev_device(vdev);
> + struct mdev_device *mdev = vm_get_mdev(vdev);
> + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev);
> + struct virtio_mdev_callback cb;
> + int i, err, queue_idx = 0;
> +
> + vm_dev->vqs = kmalloc_array(queue_idx, sizeof(*vm_dev->vqs),
> + GFP_KERNEL);
kmalloc_array(0, ...)? I would have expected nvqs instead of queue_idx
(0).
What is this the purpose of vm_dev->vqs and does anything ever access it?
-------------- next part --------------
A non-text attachment was scrubbed...
Na...
2018 Jul 25
3
[PATCH 1/2] tools/virtio: add dma barrier stubs
Fixes: 55e49dc43a8 ("virtio_ring: switch to dma_XX barriers for rpmsg")
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
tools/virtio/asm/barrier.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/virtio/asm/barrier.h b/tools/virtio/asm/barrier.h
index 0ac3caf90877..d0351f83aebe 100644
--- a/tools/virtio/asm/barrier.h
+++
2020 Jun 17
4
[PATCH RFC v8 02/11] vhost: use batched get_vq_desc version
On 2020/6/11 ??7:34, Michael S. Tsirkin wrote:
> static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq)
> {
> kfree(vq->descs);
> @@ -394,6 +400,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev)
> for (i = 0; i < dev->nvqs; ++i) {
> vq = dev->vqs[i];
> vq->max_descs = dev->iov_limit;
> + if
2020 Jun 17
4
[PATCH RFC v8 02/11] vhost: use batched get_vq_desc version
On 2020/6/11 ??7:34, Michael S. Tsirkin wrote:
> static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq)
> {
> kfree(vq->descs);
> @@ -394,6 +400,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev)
> for (i = 0; i < dev->nvqs; ++i) {
> vq = dev->vqs[i];
> vq->max_descs = dev->iov_limit;
> + if
2017 Aug 03
0
[PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
On 08/03/2017 04:13 PM, Pankaj Gupta wrote:
>>
>> + /* Allocate space for find_vqs parameters */
>> + vqs = kcalloc(nvqs, sizeof(*vqs), GFP_KERNEL);
>> + if (!vqs)
>> + goto err_vq;
>> + callbacks = kmalloc_array(nvqs, sizeof(*callbacks), GFP_KERNEL);
>> + if (!callbacks)
>> + goto err_callback;
>> + names = kmalloc_array(nvqs, sizeof(*names), GFP_KERNEL);
>
> is size here (integer) intentional?
Sorry, I didn't get it....
2013 Sep 26
2
[PATCH RESEND v3 0/7] Enable Drivers for Intel MIC X100 Coprocessors.
On Thu, Sep 05, 2013 at 06:36:08PM -0700, Joe Perches wrote:
> Whitespace neatening...
>
> Multiline statement argument alignment.
> Argument wrapping.
> Use kmalloc_array instead of kmalloc.
>
> ---
-ENOSIGNEDOFFBY :(
2013 Sep 26
2
[PATCH RESEND v3 0/7] Enable Drivers for Intel MIC X100 Coprocessors.
On Thu, Sep 05, 2013 at 06:36:08PM -0700, Joe Perches wrote:
> Whitespace neatening...
>
> Multiline statement argument alignment.
> Argument wrapping.
> Use kmalloc_array instead of kmalloc.
>
> ---
-ENOSIGNEDOFFBY :(