Displaying 20 results from an estimated 385 matches for "out_free".
2014 Dec 09
2
[PATCH v3 3/6] virtio: allow finalize_features to fail
...| 4 +++-
> 9 files changed, 38 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/s390/kvm/virtio_ccw.c b/drivers/s390/kvm/virtio_ccw.c
> index c792b5f..789275f 100644
> --- a/drivers/s390/kvm/virtio_ccw.c
> +++ b/drivers/s390/kvm/virtio_ccw.c
> @@ -752,7 +752,7 @@ out_free:
> return rc;
> }
>
> -static void virtio_ccw_finalize_features(struct virtio_device *vdev)
> +static int virtio_ccw_finalize_features(struct virtio_device *vdev)
> {
> struct virtio_ccw_device *vcdev = to_vc_device(vdev);
> struct virtio_feature_desc *features;
>...
2014 Dec 09
2
[PATCH v3 3/6] virtio: allow finalize_features to fail
...| 4 +++-
> 9 files changed, 38 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/s390/kvm/virtio_ccw.c b/drivers/s390/kvm/virtio_ccw.c
> index c792b5f..789275f 100644
> --- a/drivers/s390/kvm/virtio_ccw.c
> +++ b/drivers/s390/kvm/virtio_ccw.c
> @@ -752,7 +752,7 @@ out_free:
> return rc;
> }
>
> -static void virtio_ccw_finalize_features(struct virtio_device *vdev)
> +static int virtio_ccw_finalize_features(struct virtio_device *vdev)
> {
> struct virtio_ccw_device *vcdev = to_vc_device(vdev);
> struct virtio_feature_desc *features;
>...
2020 Aug 24
0
[PATCH v6 01/76] KVM: SVM: nested: Don't allocate VMCB structures on stack
...AULT;
- if (copy_from_user(&save, &user_vmcb->save, sizeof(save)))
- return -EFAULT;
- if (!nested_vmcb_check_controls(&ctl))
- return -EINVAL;
+ ret = -ENOMEM;
+ ctl = kzalloc(sizeof(*ctl), GFP_KERNEL);
+ save = kzalloc(sizeof(*save), GFP_KERNEL);
+ if (!ctl || !save)
+ goto out_free;
+
+ ret = -EFAULT;
+ if (copy_from_user(ctl, &user_vmcb->control, sizeof(*ctl)))
+ goto out_free;
+ if (copy_from_user(save, &user_vmcb->save, sizeof(*save)))
+ goto out_free;
+
+ ret = -EINVAL;
+ if (!nested_vmcb_check_controls(ctl))
+ goto out_free;
/*
* Processor state c...
2014 Dec 04
1
[PATCH RFC 2/3] virtio_ccw: legacy: don't negotiate rev 1/features
...e6e5..088bdf1 100644
> --- a/drivers/s390/kvm/virtio_ccw.c
> +++ b/drivers/s390/kvm/virtio_ccw.c
> @@ -733,6 +733,9 @@ static u64 virtio_ccw_get_features(struct virtio_device *vdev)
>
> rc = le32_to_cpu(features->features);
>
> + if (vcdev->revision == 0)
> + goto out_free;
> +
> /* Read second half of the feature bits from the host. */
> features->index = 1;
> ccw->cmd_code = CCW_CMD_READ_FEAT;
> @@ -1182,9 +1185,13 @@ static int virtio_ccw_online(struct ccw_device *cdev)
> vcdev->vdev.id.vendor = cdev->id.cu_type;
> vcdev-...
2014 Dec 04
1
[PATCH RFC 2/3] virtio_ccw: legacy: don't negotiate rev 1/features
...e6e5..088bdf1 100644
> --- a/drivers/s390/kvm/virtio_ccw.c
> +++ b/drivers/s390/kvm/virtio_ccw.c
> @@ -733,6 +733,9 @@ static u64 virtio_ccw_get_features(struct virtio_device *vdev)
>
> rc = le32_to_cpu(features->features);
>
> + if (vcdev->revision == 0)
> + goto out_free;
> +
> /* Read second half of the feature bits from the host. */
> features->index = 1;
> ccw->cmd_code = CCW_CMD_READ_FEAT;
> @@ -1182,9 +1185,13 @@ static int virtio_ccw_online(struct ccw_device *cdev)
> vcdev->vdev.id.vendor = cdev->id.cu_type;
> vcdev-...
2019 Apr 26
0
[PATCH 09/10] virtio/s390: use DMA memory for ccw I/O and classic notifiers
...w;
int ret;
u64 rc;
- struct ccw1 *ccw;
- ccw = kzalloc(sizeof(*ccw), GFP_DMA | GFP_KERNEL);
+ vc_dma_alloc_struct(vdev, ccw);
if (!ccw)
return 0;
- features = kzalloc(sizeof(*features), GFP_DMA | GFP_KERNEL);
+ vc_dma_alloc_struct(vdev, features);
if (!features) {
rc = 0;
goto out_free;
@@ -774,8 +797,8 @@ static u64 virtio_ccw_get_features(struct virtio_device *vdev)
rc |= (u64)le32_to_cpu(features->features) << 32;
out_free:
- kfree(features);
- kfree(ccw);
+ vc_dma_free_struct(vdev, features);
+ vc_dma_free_struct(vdev, ccw);
return rc;
}
@@ -800,11 +823,11...
2019 May 23
0
[PATCH v2 7/8] virtio/s390: use DMA memory for ccw I/O and classic notifiers
...w;
int ret;
u64 rc;
- struct ccw1 *ccw;
- ccw = kzalloc(sizeof(*ccw), GFP_DMA | GFP_KERNEL);
+ vc_dma_alloc_struct(vdev, ccw);
if (!ccw)
return 0;
- features = kzalloc(sizeof(*features), GFP_DMA | GFP_KERNEL);
+ vc_dma_alloc_struct(vdev, features);
if (!features) {
rc = 0;
goto out_free;
@@ -775,8 +798,8 @@ static u64 virtio_ccw_get_features(struct virtio_device *vdev)
rc |= (u64)le32_to_cpu(features->features) << 32;
out_free:
- kfree(features);
- kfree(ccw);
+ vc_dma_free_struct(vdev, features);
+ vc_dma_free_struct(vdev, ccw);
return rc;
}
@@ -801,11 +824,11...
2019 May 29
0
[PATCH v3 7/8] virtio/s390: use DMA memory for ccw I/O and classic notifiers
...w;
int ret;
u64 rc;
- struct ccw1 *ccw;
- ccw = kzalloc(sizeof(*ccw), GFP_DMA | GFP_KERNEL);
+ vc_dma_alloc_struct(vdev, ccw);
if (!ccw)
return 0;
- features = kzalloc(sizeof(*features), GFP_DMA | GFP_KERNEL);
+ vc_dma_alloc_struct(vdev, features);
if (!features) {
rc = 0;
goto out_free;
@@ -775,8 +798,8 @@ static u64 virtio_ccw_get_features(struct virtio_device *vdev)
rc |= (u64)le32_to_cpu(features->features) << 32;
out_free:
- kfree(features);
- kfree(ccw);
+ vc_dma_free_struct(vdev, features);
+ vc_dma_free_struct(vdev, ccw);
return rc;
}
@@ -801,11 +824,11...
2019 Jun 06
0
[PATCH v4 7/8] virtio/s390: use DMA memory for ccw I/O and classic notifiers
...oc(sizeof(*ccw), GFP_DMA | GFP_KERNEL);
+ ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw));
if (!ccw)
return 0;
- features = kzalloc(sizeof(*features), GFP_DMA | GFP_KERNEL);
+ features = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*features));
if (!features) {
rc = 0;
goto out_free;
@@ -775,8 +787,8 @@ static u64 virtio_ccw_get_features(struct virtio_device *vdev)
rc |= (u64)le32_to_cpu(features->features) << 32;
out_free:
- kfree(features);
- kfree(ccw);
+ ccw_device_dma_free(vcdev->cdev, features, sizeof(*features));
+ ccw_device_dma_free(vcdev->cdev, c...
2019 Jun 12
0
[PATCH v5 7/8] virtio/s390: use DMA memory for ccw I/O and classic notifiers
...oc(sizeof(*ccw), GFP_DMA | GFP_KERNEL);
+ ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw));
if (!ccw)
return 0;
- features = kzalloc(sizeof(*features), GFP_DMA | GFP_KERNEL);
+ features = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*features));
if (!features) {
rc = 0;
goto out_free;
@@ -775,8 +787,8 @@ static u64 virtio_ccw_get_features(struct virtio_device *vdev)
rc |= (u64)le32_to_cpu(features->features) << 32;
out_free:
- kfree(features);
- kfree(ccw);
+ ccw_device_dma_free(vcdev->cdev, features, sizeof(*features));
+ ccw_device_dma_free(vcdev->cdev, c...
2014 Dec 09
0
[PATCH v3 3/6] virtio: allow finalize_features to fail
..., 38 insertions(+), 16 deletions(-)
> >
>
> > diff --git a/drivers/s390/kvm/virtio_ccw.c b/drivers/s390/kvm/virtio_ccw.c
> > index c792b5f..789275f 100644
> > --- a/drivers/s390/kvm/virtio_ccw.c
> > +++ b/drivers/s390/kvm/virtio_ccw.c
> > @@ -752,7 +752,7 @@ out_free:
> > return rc;
> > }
> >
> > -static void virtio_ccw_finalize_features(struct virtio_device *vdev)
> > +static int virtio_ccw_finalize_features(struct virtio_device *vdev)
> > {
> > struct virtio_ccw_device *vcdev = to_vc_device(vdev);
> > s...
2014 Dec 09
0
[PATCH v3 3/6] virtio: allow finalize_features to fail
..., 38 insertions(+), 16 deletions(-)
> >
>
> > diff --git a/drivers/s390/kvm/virtio_ccw.c b/drivers/s390/kvm/virtio_ccw.c
> > index c792b5f..789275f 100644
> > --- a/drivers/s390/kvm/virtio_ccw.c
> > +++ b/drivers/s390/kvm/virtio_ccw.c
> > @@ -752,7 +752,7 @@ out_free:
> > return rc;
> > }
> >
> > -static void virtio_ccw_finalize_features(struct virtio_device *vdev)
> > +static int virtio_ccw_finalize_features(struct virtio_device *vdev)
> > {
> > struct virtio_ccw_device *vcdev = to_vc_device(vdev);
> > s...
2014 Dec 04
5
[PATCH RFC 1/3] virtio: add API to detect legacy devices
transports need to be able to detect legacy-only
devices (ATM balloon only) to use legacy path
to drive them.
Add a core API to do just that.
The implementation just blacklists balloon:
not too pretty, but let's not over-engineer.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
include/linux/virtio.h | 2 ++
drivers/virtio/virtio.c | 6 ++++++
2 files changed, 8
2014 Dec 04
5
[PATCH RFC 1/3] virtio: add API to detect legacy devices
transports need to be able to detect legacy-only
devices (ATM balloon only) to use legacy path
to drive them.
Add a core API to do just that.
The implementation just blacklists balloon:
not too pretty, but let's not over-engineer.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
include/linux/virtio.h | 2 ++
drivers/virtio/virtio.c | 6 ++++++
2 files changed, 8
2020 May 29
2
[PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new
...ubdev/clk/gm20b.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c
@@ -1039,7 +1039,7 @@ gm20b_clk_new(struct nvkm_device *device, int index, struct nvkm_clk **pclk)
ret = gk20a_clk_ctor(device, index, &gm20b_clk, clk_params,
&clk->base);
if (ret)
- return ret;
+ goto out_free;
/*
* NAPLL can only work with max_u, clamp the m range so
@@ -1067,8 +1067,8 @@ gm20b_clk_new(struct nvkm_device *device, int index, struct nvkm_clk **pclk)
nvkm_warn(subdev, "no fused calibration parameters\n");
ret = gm20b_clk_init_safe_fmax(clk);
- if (ret)
- return ret...
2019 Jun 28
1
[PATCH v4 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...fter virtio_gpu_cmd_submit. We probably don't want other
> processes to see the semi-initialized fence.
Good point. Fixed.
> > out_memdup:
> > kfree(buf);
> > out_unresv:
> > - ttm_eu_backoff_reservation(&ticket, &validate_list);
> > -out_free:
> > - virtio_gpu_unref_list(&validate_list);
> Keeping out_free to free buflist seems just fine.
We don't need the separate label though ...
> > + drm_gem_unlock_reservations(buflist->objs, buflist->nents, &ticket);
> > out_unused_fd:
> >...
2019 Jun 20
2
[PATCH v4 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...= virtio_gpu_array_from_handles(drm_file, bo_handles,
+ exbuf->num_bo_handles);
+ if (!buflist) {
+ ret = -ENOENT;
+ goto out_unused_fd;
}
kvfree(bo_handles);
bo_handles = NULL;
}
- ret = virtio_gpu_object_list_validate(&ticket, &validate_list);
- if (ret)
- goto out_free;
+ if (buflist) {
+ ret = drm_gem_lock_reservations(buflist->objs, buflist->nents,
+ &ticket);
+ if (ret)
+ goto out_unused_fd;
+ }
buf = memdup_user(u64_to_user_ptr(exbuf->command), exbuf->size);
if (IS_ERR(buf)) {
@@ -219,25 +208,26 @@ static int virtio_gpu_execbuff...
2019 Jun 20
2
[PATCH v4 08/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...= virtio_gpu_array_from_handles(drm_file, bo_handles,
+ exbuf->num_bo_handles);
+ if (!buflist) {
+ ret = -ENOENT;
+ goto out_unused_fd;
}
kvfree(bo_handles);
bo_handles = NULL;
}
- ret = virtio_gpu_object_list_validate(&ticket, &validate_list);
- if (ret)
- goto out_free;
+ if (buflist) {
+ ret = drm_gem_lock_reservations(buflist->objs, buflist->nents,
+ &ticket);
+ if (ret)
+ goto out_unused_fd;
+ }
buf = memdup_user(u64_to_user_ptr(exbuf->command), exbuf->size);
if (IS_ERR(buf)) {
@@ -219,25 +208,26 @@ static int virtio_gpu_execbuff...
2019 Jun 18
2
[PATCH v2 07/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...d(&buflist[i].head, &validate_list);
+ buflist[i] = gobj;
}
kvfree(bo_handles);
bo_handles = NULL;
}
- ret = virtio_gpu_object_list_validate(&ticket, &validate_list);
+ ret = drm_gem_lock_reservations(buflist, exbuf->num_bo_handles, &ticket);
if (ret)
- goto out_free;
+ goto out_unused_fd;
buf = memdup_user(u64_to_user_ptr(exbuf->command), exbuf->size);
if (IS_ERR(buf)) {
@@ -222,21 +216,25 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
virtio_gpu_cmd_submit(vgdev, buf, exbuf->size,
vfpriv->ctx_id, o...
2019 Jun 18
2
[PATCH v2 07/12] drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing
...d(&buflist[i].head, &validate_list);
+ buflist[i] = gobj;
}
kvfree(bo_handles);
bo_handles = NULL;
}
- ret = virtio_gpu_object_list_validate(&ticket, &validate_list);
+ ret = drm_gem_lock_reservations(buflist, exbuf->num_bo_handles, &ticket);
if (ret)
- goto out_free;
+ goto out_unused_fd;
buf = memdup_user(u64_to_user_ptr(exbuf->command), exbuf->size);
if (IS_ERR(buf)) {
@@ -222,21 +216,25 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
virtio_gpu_cmd_submit(vgdev, buf, exbuf->size,
vfpriv->ctx_id, o...