Displaying 20 results from an estimated 4010 matches for "kfree".
Did you mean:
free
2009 Mar 31
0
[PATCH] ocfs2: remove some pointless conditionals before kfree()
Remove some pointless conditionals before kfree().
Signed-off-by: Wei Yongjun <yjwei at cn.fujitsu.com>
---
fs/ocfs2/alloc.c | 3 +--
fs/ocfs2/cluster/heartbeat.c | 6 ++----
fs/ocfs2/cluster/tcp.c | 6 ++----
fs/ocfs2/dlm/dlmdomain.c | 3 +--
fs/ocfs2/dlm/dlmrecovery.c | 6 ++----
fs/ocfs2/extent_m...
2005 Mar 25
1
[PATCH] kfree() NULL pointer cleanups - no need to check - fs/ext3/
kfree() handles NULL pointers fine - checking is redundant.
Signed-off-by: Jesper Juhl <juhl-lkml at dif.dk>
--- linux-2.6.12-rc1-mm3-orig/fs/ext3/acl.c 2005-03-02 08:37:55.000000000 +0100
+++ linux-2.6.12-rc1-mm3/fs/ext3/acl.c 2005-03-25 22:41:41.000000000 +0100
@@ -197,8 +197,7 @@ ext3_get_acl(...
2013 Jul 19
1
[PATCH 03/10] virtio: console: clean up port data immediately at time of unplug
...t;> port = container_of(kref, struct port, kref);
>>>
>>> - sysfs_remove_group(&port->dev->kobj, &port_attribute_group);
>>> - device_destroy(pdrvdata.class, port->dev->devt);
>>> - cdev_del(port->cdev);
>>> -
>>> - kfree(port->name);
>>> -
>>> - debugfs_remove(port->debugfs_file);
>>> -
>>> kfree(port);
>>> }
>>>
>>> @@ -1566,6 +1558,14 @@ static void unplug_port(struct port *port)
>>> */
>>> port->portdev = NULL;
&g...
2013 Jul 19
1
[PATCH 03/10] virtio: console: clean up port data immediately at time of unplug
...t;> port = container_of(kref, struct port, kref);
>>>
>>> - sysfs_remove_group(&port->dev->kobj, &port_attribute_group);
>>> - device_destroy(pdrvdata.class, port->dev->devt);
>>> - cdev_del(port->cdev);
>>> -
>>> - kfree(port->name);
>>> -
>>> - debugfs_remove(port->debugfs_file);
>>> -
>>> kfree(port);
>>> }
>>>
>>> @@ -1566,6 +1558,14 @@ static void unplug_port(struct port *port)
>>> */
>>> port->portdev = NULL;
&g...
2020 Jan 03
3
[PATCH] drm/nouveau/bios: fix incorrect kfree in platform_init
Hi, I think there has a incorrect kfree in pcirom_init function. In
pcirom_init function priv porinter could be free only when priv != null
and priv->rom is null.
Signed-off-by: wuxu.wu <wuxu.wu at huawei.com>
---
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff...
2013 Jul 19
2
[PATCH 03/10] virtio: console: clean up port data immediately at time of unplug
...static void remove_port(struct kref *kref)
>
> port = container_of(kref, struct port, kref);
>
> - sysfs_remove_group(&port->dev->kobj, &port_attribute_group);
> - device_destroy(pdrvdata.class, port->dev->devt);
> - cdev_del(port->cdev);
> -
> - kfree(port->name);
> -
> - debugfs_remove(port->debugfs_file);
> -
> kfree(port);
> }
>
> @@ -1566,6 +1558,14 @@ static void unplug_port(struct port *port)
> */
> port->portdev = NULL;
>
> + sysfs_remove_group(&port->dev->kobj, &port_att...
2013 Jul 19
2
[PATCH 03/10] virtio: console: clean up port data immediately at time of unplug
...static void remove_port(struct kref *kref)
>
> port = container_of(kref, struct port, kref);
>
> - sysfs_remove_group(&port->dev->kobj, &port_attribute_group);
> - device_destroy(pdrvdata.class, port->dev->devt);
> - cdev_del(port->cdev);
> -
> - kfree(port->name);
> -
> - debugfs_remove(port->debugfs_file);
> -
> kfree(port);
> }
>
> @@ -1566,6 +1558,14 @@ static void unplug_port(struct port *port)
> */
> port->portdev = NULL;
>
> + sysfs_remove_group(&port->dev->kobj, &port_att...
2019 Apr 26
0
[PATCH 09/10] virtio/s390: use DMA memory for ccw I/O and classic notifiers
...indicators(vcdev)));
if (!indicatorp)
return;
*indicatorp = 0;
@@ -368,8 +387,9 @@ static void virtio_ccw_drop_indicator(struct virtio_ccw_device *vcdev,
"Failed to deregister indicators (%d)\n", ret);
else if (vcdev->is_thinint)
virtio_ccw_drop_indicators(vcdev);
- kfree(indicatorp);
- kfree(thinint_area);
+ __vc_dma_free(&vcdev->vdev, sizeof(indicators(vcdev)),
+ indicatorp);
+ vc_dma_free_struct(&vcdev->vdev, thinint_area);
}
static inline long __do_kvm_notify(struct subchannel_id schid,
@@ -416,15 +436,15 @@ static int virtio_ccw_read_vq...
2019 May 23
0
[PATCH v2 7/8] virtio/s390: use DMA memory for ccw I/O and classic notifiers
...indicators(vcdev)));
if (!indicatorp)
return;
*indicatorp = 0;
@@ -369,8 +388,9 @@ static void virtio_ccw_drop_indicator(struct virtio_ccw_device *vcdev,
"Failed to deregister indicators (%d)\n", ret);
else if (vcdev->is_thinint)
virtio_ccw_drop_indicators(vcdev);
- kfree(indicatorp);
- kfree(thinint_area);
+ __vc_dma_free(&vcdev->vdev, sizeof(indicators(vcdev)),
+ indicatorp);
+ vc_dma_free_struct(&vcdev->vdev, thinint_area);
}
static inline long __do_kvm_notify(struct subchannel_id schid,
@@ -417,15 +437,15 @@ static int virtio_ccw_read_vq...
2019 May 29
0
[PATCH v3 7/8] virtio/s390: use DMA memory for ccw I/O and classic notifiers
...indicators(vcdev)));
if (!indicatorp)
return;
*indicatorp = 0;
@@ -369,8 +388,9 @@ static void virtio_ccw_drop_indicator(struct virtio_ccw_device *vcdev,
"Failed to deregister indicators (%d)\n", ret);
else if (vcdev->is_thinint)
virtio_ccw_drop_indicators(vcdev);
- kfree(indicatorp);
- kfree(thinint_area);
+ __vc_dma_free(&vcdev->vdev, sizeof(indicators(vcdev)),
+ indicatorp);
+ vc_dma_free_struct(&vcdev->vdev, thinint_area);
}
static inline long __do_kvm_notify(struct subchannel_id schid,
@@ -417,15 +437,15 @@ static int virtio_ccw_read_vq...
2019 Jun 06
0
[PATCH v4 7/8] virtio/s390: use DMA memory for ccw I/O and classic notifiers
...indicators(vcdev)));
if (!indicatorp)
return;
*indicatorp = 0;
@@ -369,8 +373,8 @@ static void virtio_ccw_drop_indicator(struct virtio_ccw_device *vcdev,
"Failed to deregister indicators (%d)\n", ret);
else if (vcdev->is_thinint)
virtio_ccw_drop_indicators(vcdev);
- kfree(indicatorp);
- kfree(thinint_area);
+ ccw_device_dma_free(vcdev->cdev, indicatorp, sizeof(indicators(vcdev)));
+ ccw_device_dma_free(vcdev->cdev, thinint_area, sizeof(*thinint_area));
}
static inline long __do_kvm_notify(struct subchannel_id schid,
@@ -417,15 +421,15 @@ static int virtio_...
2019 Jun 12
0
[PATCH v5 7/8] virtio/s390: use DMA memory for ccw I/O and classic notifiers
...indicators(vcdev)));
if (!indicatorp)
return;
*indicatorp = 0;
@@ -369,8 +373,8 @@ static void virtio_ccw_drop_indicator(struct virtio_ccw_device *vcdev,
"Failed to deregister indicators (%d)\n", ret);
else if (vcdev->is_thinint)
virtio_ccw_drop_indicators(vcdev);
- kfree(indicatorp);
- kfree(thinint_area);
+ ccw_device_dma_free(vcdev->cdev, indicatorp, sizeof(indicators(vcdev)));
+ ccw_device_dma_free(vcdev->cdev, thinint_area, sizeof(*thinint_area));
}
static inline long __do_kvm_notify(struct subchannel_id schid,
@@ -417,15 +421,15 @@ static int virtio_...
2017 Dec 12
1
[PATCH 2/3] virtio: use put_device instead of kfree
...hod similar to virtio PCI.
> - * Provide an empty one to avoid getting a warning from core.
> - */
> + struct virtio_device *vdev =
> + container_of(_d, struct virtio_device, dev);
> + struct _vop_vdev *vop_vdev =
> + container_of(vdev, struct _vop_vdev, vdev);
> +
> + kfree(vop_vdev);
> }
>
> /*
> @@ -501,7 +503,9 @@ static int _vop_add_device(struct mic_device_desc __iomem *d,
> dev_err(_vop_dev(vdev),
> "Failed to register vop device %u type %u\n",
> offset, type);
> - goto free_irq;
> + vpdev->hw_ops->free...
2017 Dec 12
1
[PATCH 2/3] virtio: use put_device instead of kfree
...hod similar to virtio PCI.
> - * Provide an empty one to avoid getting a warning from core.
> - */
> + struct virtio_device *vdev =
> + container_of(_d, struct virtio_device, dev);
> + struct _vop_vdev *vop_vdev =
> + container_of(vdev, struct _vop_vdev, vdev);
> +
> + kfree(vop_vdev);
> }
>
> /*
> @@ -501,7 +503,9 @@ static int _vop_add_device(struct mic_device_desc __iomem *d,
> dev_err(_vop_dev(vdev),
> "Failed to register vop device %u type %u\n",
> offset, type);
> - goto free_irq;
> + vpdev->hw_ops->free...
2020 Jun 16
1
[PATCH v4 3/3] btrfs: Use kfree() in btrfs_ioctl_get_subvol_info()
...9:57:18PM -0400, Waiman Long wrote:
> In btrfs_ioctl_get_subvol_info(), there is a classic case where kzalloc()
> was incorrectly paired with kzfree(). According to David Sterba, there
> isn't any sensitive information in the subvol_info that needs to be
> cleared before freeing. So kfree_sensitive() isn't really needed,
> use kfree() instead.
>
> Reported-by: David Sterba <dsterba at suse.cz>
> Signed-off-by: Waiman Long <longman at redhat.com>
> ---
> fs/btrfs/ioctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --g...
2013 Mar 05
4
[RFC PATCH] drm/nouveau: use vmalloc for pgt allocation
...gt;> (vmm->pgt_bits + 12);
vm->lpde = (offset + length - 1) >> (vmm->pgt_bits + 12);
- vm->pgt = kcalloc(vm->lpde - vm->fpde + 1, sizeof(*vm->pgt), GFP_KERNEL);
+ vm->pgt = vzalloc((vm->lpde - vm->fpde + 1) * sizeof(*vm->pgt));
if (!vm->pgt) {
kfree(vm);
return -ENOMEM;
@@ -371,7 +371,7 @@ nouveau_vm_create(struct nouveau_vmmgr *vmm, u64 offset, u64 length,
ret = nouveau_mm_init(&vm->mm, mm_offset >> 12, mm_length >> 12,
block >> 12);
if (ret) {
- kfree(vm->pgt);
+ vfree(vm->pgt);
kfree(vm);...
2017 Dec 17
6
[PATCH v3 0/5] proper cleanup if fail to register_virtio_device
Hi,
Patch1 add a helper to get virtio_device's status which will be used
later.
Patch2~4: check virtio_device's status is RTIO_CONFIG_S_ACKNOWLEDGE
or not, if so use put_device otherwise use kfree.
Patch5: add comments for virtio_register_device help caller do a
proper cleanup if got failure.
weiping zhang (5):
virtio: add helper virtio_get_status
virtio_pci: don't kfree device on register failure
virtio_vop: don't kfree device on register failure
virtio_remoteproc: don'...
2017 Dec 17
6
[PATCH v3 0/5] proper cleanup if fail to register_virtio_device
Hi,
Patch1 add a helper to get virtio_device's status which will be used
later.
Patch2~4: check virtio_device's status is RTIO_CONFIG_S_ACKNOWLEDGE
or not, if so use put_device otherwise use kfree.
Patch5: add comments for virtio_register_device help caller do a
proper cleanup if got failure.
weiping zhang (5):
virtio: add helper virtio_get_status
virtio_pci: don't kfree device on register failure
virtio_vop: don't kfree device on register failure
virtio_remoteproc: don'...
2020 Feb 11
1
[PATCH V2 5/5] vdpasim: vDPA device simulator
...release = vdpasim_release_dev;
The driver should not provide the release function.
Again the safest model is 'vdpa_alloc_device' which combines the
kzalloc and the vdpa_init_device() and returns something that is
error unwound with put_device()
The subsystem owns the release and does the kfree and other cleanup
like releasing the IDA.
> + vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu);
> + vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu);
> +
> + dev = &vdpa->dev;
> + dev->coherent_dma_mask = DMA_BIT_MASK(64);
> + set_dma...
2013 Sep 17
3
[PATCH] vhost/scsi: use vmalloc for order-10 allocation
...host/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1373,21 +1373,30 @@ static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features)
return 0;
}
+static void vhost_scsi_free(struct vhost_scsi *vs)
+{
+ if (is_vmalloc_addr(vs))
+ vfree(vs);
+ else
+ kfree(vs);
+}
+
static int vhost_scsi_open(struct inode *inode, struct file *f)
{
struct vhost_scsi *vs;
struct vhost_virtqueue **vqs;
- int r, i;
+ int r = -ENOMEM, i;
- vs = kzalloc(sizeof(*vs), GFP_KERNEL);
- if (!vs)
- return -ENOMEM;
+ vs = kzalloc(sizeof(*vs), GFP_KERNEL | __GFP_NOW...