search for: err_cast

Displaying 20 results from an estimated 82 matches for "err_cast".

2010 Oct 30
0
[PATCH] Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) - generated by Coccinelle
This patch was generated using the Coccinelle scripts and btrfs code in v2.6.36-9657-g7a3f8fe. Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) The semantic patch that makes this change is available in scripts/coccinelle/api/err_cast.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Chris Samuel <chris@csamuel.org> diff...
2020 Aug 11
3
[PATCH] drm/nouveau/gem: Use vmemdup_user() rather than duplicating its implementation
From: Markus Elfring <elfring at users.sourceforge.net> Date: Tue, 11 Aug 2020 19:25:22 +0200 Reuse existing functionality from vmemdup_user() instead of keeping duplicate source code. Generated by: scripts/coccinelle/api/memdup_user.cocci Signed-off-by: Markus Elfring <elfring at users.sourceforge.net> --- drivers/gpu/drm/nouveau/nouveau_gem.c | 12 +++--------- 1 file changed, 3
2013 Dec 13
2
[PATCH] Btrfs: fix error check of btrfs_lookup_dentry()
...ry, unsigned int flags) { - struct dentry *ret; + struct inode *inode; - ret = d_splice_alias(btrfs_lookup_dentry(dir, dentry), dentry); - return ret; + inode = btrfs_lookup_dentry(dir, dentry); + if (IS_ERR(inode)) { + if (PTR_ERR(inode) == -ENOENT) + inode = NULL; + else + return ERR_CAST(inode); + } + + return d_splice_alias(inode, dentry); } unsigned char btrfs_filetype_table[] = { diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 9d46f60..716779c 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -389,6 +389,7 @@ static noinline int create_subvol(struct inode *dir,...
2017 Mar 14
1
[PATCH] drm: virtio: fix eno.cocci warnings
...n(+), 1 deletion(-) --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -97,7 +97,7 @@ virtio_gpu_get_vbuf(struct virtio_gpu_de struct virtio_gpu_vbuffer *vbuf; vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL); - if (IS_ERR(vbuf)) + if (!vbuf) return ERR_CAST(vbuf); memset(vbuf, 0, VBUFFER_SIZE);
2017 Mar 14
1
[PATCH] drm: virtio: fix eno.cocci warnings
...n(+), 1 deletion(-) --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -97,7 +97,7 @@ virtio_gpu_get_vbuf(struct virtio_gpu_de struct virtio_gpu_vbuffer *vbuf; vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL); - if (IS_ERR(vbuf)) + if (!vbuf) return ERR_CAST(vbuf); memset(vbuf, 0, VBUFFER_SIZE);
2017 Mar 01
2
[PATCH] drm: virtio: use kmem_cache
...ON(list_empty(&vgdev->free_vbufs)); - vbuf = list_first_entry(&vgdev->free_vbufs, - struct virtio_gpu_vbuffer, list); - list_del(&vbuf->list); - spin_unlock(&vgdev->free_vbufs_lock); + vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL); + if (IS_ERR(vbuf)) + return ERR_CAST(vbuf); memset(vbuf, 0, VBUFFER_SIZE); BUG_ON(size > MAX_INLINE_CMD_SIZE); @@ -208,9 +173,7 @@ static void free_vbuf(struct virtio_gpu_device *vgdev, if (vbuf->resp_size > MAX_INLINE_RESP_SIZE) kfree(vbuf->resp_buf); kfree(vbuf->data_buf); - spin_lock(&vgdev->free_...
2017 Mar 01
2
[PATCH] drm: virtio: use kmem_cache
...ON(list_empty(&vgdev->free_vbufs)); - vbuf = list_first_entry(&vgdev->free_vbufs, - struct virtio_gpu_vbuffer, list); - list_del(&vbuf->list); - spin_unlock(&vgdev->free_vbufs_lock); + vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL); + if (IS_ERR(vbuf)) + return ERR_CAST(vbuf); memset(vbuf, 0, VBUFFER_SIZE); BUG_ON(size > MAX_INLINE_CMD_SIZE); @@ -208,9 +173,7 @@ static void free_vbuf(struct virtio_gpu_device *vgdev, if (vbuf->resp_size > MAX_INLINE_RESP_SIZE) kfree(vbuf->resp_buf); kfree(vbuf->data_buf); - spin_lock(&vgdev->free_...
2017 Mar 13
1
[PATCH] drm: virtio: fix kmem_cache_alloc error check
...eb96fb2 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -97,8 +97,8 @@ void virtio_gpu_free_vbufs(struct virtio_gpu_device *vgdev) struct virtio_gpu_vbuffer *vbuf; vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL); - if (IS_ERR(vbuf)) - return ERR_CAST(vbuf); + if (!vbuf) + return ERR_PTR(-ENOMEM); memset(vbuf, 0, VBUFFER_SIZE); BUG_ON(size > MAX_INLINE_CMD_SIZE); -- 1.8.3.1
2017 Mar 13
1
[PATCH] drm: virtio: fix kmem_cache_alloc error check
...eb96fb2 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -97,8 +97,8 @@ void virtio_gpu_free_vbufs(struct virtio_gpu_device *vgdev) struct virtio_gpu_vbuffer *vbuf; vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL); - if (IS_ERR(vbuf)) - return ERR_CAST(vbuf); + if (!vbuf) + return ERR_PTR(-ENOMEM); memset(vbuf, 0, VBUFFER_SIZE); BUG_ON(size > MAX_INLINE_CMD_SIZE); -- 1.8.3.1
2011 Jun 29
0
[PATCH v3] Btrfs: fix error check of btrfs_lookup_dentry()
...ion.type == BTRFS_INODE_ITEM_KEY) { inode = btrfs_iget(dir->i_sb, &location, root, NULL); @@ -4080,8 +4080,12 @@ static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry, struct inode *inode; inode = btrfs_lookup_dentry(dir, dentry); - if (IS_ERR(inode)) - return ERR_CAST(inode); + if (IS_ERR(inode)) { + if (PTR_ERR(inode) == -ENOENT) + inode = NULL; + else + return ERR_CAST(inode); + } return d_splice_alias(inode, dentry); } diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index a3c4751..981084d 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -32...
2019 Jun 03
2
[PATCH v3 3/8] s390/cio: add basic protected virtualization support
...--- > drivers/s390/cio/io_sch.h | 20 +++++++++--- > drivers/s390/virtio/virtio_ccw.c | 10 ------ > 10 files changed, 163 insertions(+), 83 deletions(-) (...) > @@ -1593,20 +1625,31 @@ struct ccw_device * __init ccw_device_create_console(struct ccw_driver *drv) > return ERR_CAST(sch); > > io_priv = kzalloc(sizeof(*io_priv), GFP_KERNEL | GFP_DMA); > - if (!io_priv) { > - put_device(&sch->dev); > - return ERR_PTR(-ENOMEM); > - } > + if (!io_priv) > + goto err_priv; > + io_priv->dma_area = dma_alloc_coherent(&sch->dev, > +...
2019 Jun 03
2
[PATCH v3 3/8] s390/cio: add basic protected virtualization support
...--- > drivers/s390/cio/io_sch.h | 20 +++++++++--- > drivers/s390/virtio/virtio_ccw.c | 10 ------ > 10 files changed, 163 insertions(+), 83 deletions(-) (...) > @@ -1593,20 +1625,31 @@ struct ccw_device * __init ccw_device_create_console(struct ccw_driver *drv) > return ERR_CAST(sch); > > io_priv = kzalloc(sizeof(*io_priv), GFP_KERNEL | GFP_DMA); > - if (!io_priv) { > - put_device(&sch->dev); > - return ERR_PTR(-ENOMEM); > - } > + if (!io_priv) > + goto err_priv; > + io_priv->dma_area = dma_alloc_coherent(&sch->dev, > +...
2019 Jun 03
1
[PATCH v3 3/8] s390/cio: add basic protected virtualization support
...ote: > On 03.06.19 14:06, Cornelia Huck wrote: > > On Wed, 29 May 2019 14:26:52 +0200 > > Michael Mueller <mimu at linux.ibm.com> wrote: > >> @@ -1593,20 +1625,31 @@ struct ccw_device * __init ccw_device_create_console(struct ccw_driver *drv) > >> return ERR_CAST(sch); > >> > >> io_priv = kzalloc(sizeof(*io_priv), GFP_KERNEL | GFP_DMA); > >> - if (!io_priv) { > >> - put_device(&sch->dev); > >> - return ERR_PTR(-ENOMEM); > >> - } > >> + if (!io_priv) > >> + goto err_priv;...
2019 May 27
3
[PATCH v2 3/8] s390/cio: add basic protected virtualization support
...drivers/s390/cio/io_sch.h | 20 +++++++++---- > drivers/s390/virtio/virtio_ccw.c | 10 ------- > 10 files changed, 164 insertions(+), 83 deletions(-) > (...) > @@ -1593,20 +1622,31 @@ struct ccw_device * __init ccw_device_create_console(struct ccw_driver *drv) > return ERR_CAST(sch); > > io_priv = kzalloc(sizeof(*io_priv), GFP_KERNEL | GFP_DMA); > - if (!io_priv) { > - put_device(&sch->dev); > - return ERR_PTR(-ENOMEM); > - } > + if (!io_priv) > + goto err_priv; > + io_priv->dma_area = dma_alloc_coherent(&sch->dev, > +...
2019 May 27
3
[PATCH v2 3/8] s390/cio: add basic protected virtualization support
...drivers/s390/cio/io_sch.h | 20 +++++++++---- > drivers/s390/virtio/virtio_ccw.c | 10 ------- > 10 files changed, 164 insertions(+), 83 deletions(-) > (...) > @@ -1593,20 +1622,31 @@ struct ccw_device * __init ccw_device_create_console(struct ccw_driver *drv) > return ERR_CAST(sch); > > io_priv = kzalloc(sizeof(*io_priv), GFP_KERNEL | GFP_DMA); > - if (!io_priv) { > - put_device(&sch->dev); > - return ERR_PTR(-ENOMEM); > - } > + if (!io_priv) > + goto err_priv; > + io_priv->dma_area = dma_alloc_coherent(&sch->dev, > +...
2011 Jun 09
2
[PATCH] Btrfs: turn to readonly if btrfs_start_transaction() fails
...fs_commit_transaction_async(trans, root, 0); if (ret) { diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index f25b10a..d2c2422 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -3902,8 +3902,10 @@ struct inode *create_reloc_inode(struct btrfs_fs_info *fs_info, return ERR_CAST(root); trans = btrfs_start_transaction(root, 6); - if (IS_ERR(trans)) + if (IS_ERR(trans)) { + btrfs_abort_transaction(root, PTR_ERR(trans)); return ERR_CAST(trans); + } err = btrfs_find_free_objectid(root, &objectid); if (err) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c inde...
2019 Sep 16
4
[PATCH 0/4] drm/nouveau: Miscellaneous fixes
From: Thierry Reding <treding at nvidia.com> Hi Ben, these are fixes for a couple of issues that I've been running into when testing on various Tegra boards. The first two patches fix up issues in the fix that I had sent out earlier to fix the regression introduced in drm-misc-next. The first one is critical because it avoids a BUG_ON as reported by Ilia, while the second is less
2019 May 27
2
[PATCH v2 3/8] s390/cio: add basic protected virtualization support
...irtio/virtio_ccw.c | 10 ------- > > > 10 files changed, 164 insertions(+), 83 deletions(-) > > > > > > > (...) > > > > > @@ -1593,20 +1622,31 @@ struct ccw_device * __init ccw_device_create_console(struct ccw_driver *drv) > > > return ERR_CAST(sch); > > > > > > io_priv = kzalloc(sizeof(*io_priv), GFP_KERNEL | GFP_DMA); > > > - if (!io_priv) { > > > - put_device(&sch->dev); > > > - return ERR_PTR(-ENOMEM); > > > - } > > > + if (!io_priv) > > > + goto err...
2019 May 27
2
[PATCH v2 3/8] s390/cio: add basic protected virtualization support
...irtio/virtio_ccw.c | 10 ------- > > > 10 files changed, 164 insertions(+), 83 deletions(-) > > > > > > > (...) > > > > > @@ -1593,20 +1622,31 @@ struct ccw_device * __init ccw_device_create_console(struct ccw_driver *drv) > > > return ERR_CAST(sch); > > > > > > io_priv = kzalloc(sizeof(*io_priv), GFP_KERNEL | GFP_DMA); > > > - if (!io_priv) { > > > - put_device(&sch->dev); > > > - return ERR_PTR(-ENOMEM); > > > - } > > > + if (!io_priv) > > > + goto err...
2020 Aug 13
0
[PATCH] drm/nouveau/gem: Use vmemdup_user() rather than duplicating its implementation
...tached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp at intel.com> coccinelle warnings: (new ones prefixed by >>) >> drivers/gpu/drm/nouveau/nouveau_gem.c:589:9-16: WARNING: ERR_CAST can be used with mem Please review and possibly fold the followup patch. --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all at lists.01.org -------------- next part -------------- A non-text attachment was scrubbed... Name: .config.gz Type: applica...