search for: is_err_or_null

Displaying 20 results from an estimated 69 matches for "is_err_or_null".

2014 Jan 07
0
[PATCH net-next v2 4/4] virtio-net: initial debugfs support, export mergeable rx buffer size
...ease, +}; + +static void receive_queue_debugfs_add(struct receive_queue *rq) +{ + struct virtnet_info *vi = rq->vq->vdev->priv; + unsigned int rq_index = vq2rxq(rq->vq); + struct receive_queue_stats *rq_stats = vi->rq_stats[rq_index]; + struct dentry *dentry; + char name[32]; + + if (IS_ERR_OR_NULL(vi->dbg_dev_root)) + return; + scnprintf(name, sizeof(name), "rx-%u", rq_index); + dentry = debugfs_create_dir(name, vi->dbg_dev_root); + if (IS_ERR_OR_NULL(dentry)) { + pr_warn("%s: could not create %s rx queue debugfs dir\n", + vi->dev->name, name); + return;...
2023 Nov 07
2
[bug report] drm/nouveau/gsp/r535: add support for booting GSP-RM
...oading_guest_driver_v1F_07 *rpc; > 1014 > 1015 rpc = nvkm_gsp_rpc_get(gsp, NV_VGPU_MSG_FUNCTION_UNLOADING_GUEST_DRIVER, sizeof(*rpc)); > > nvkm_gsp_rpc_get() returns NULL on error. There are also code paths where it can return an ERR_PTR. I think we need to check for IS_ERR_OR_NULL()... > > --> 1016 if (IS_ERR(rpc)) > 1017 return PTR_ERR(rpc); > 1018 > 1019 if (suspend) { > 1020 rpc->bInPMTransition = 1; > 1021 rpc->bGc6Entering = 0; > 1022...
2024 Oct 31
16
[PATCH v3 00/15] NVKM GSP RPC kernel docs, cleanups and fixes
Hi folks: Here is the leftover of the previous spin of NVKM GSP RPC fixes, which is handling the return of large GSP message. PATCH 1 and 2 in the previous spin were merged [1], and this spin is based on top of PATCH 1 and PATCH 2 in the previous spin. Besides the support of the large GSP message, kernel doc and many cleanups are introduced according to the comments in the previous spin [2].
2018 May 23
3
[PATCH] block drivers/block: Use octal not symbolic permissions
...bugfs_create_file("in_flight_summary", S_IRUSR|S_IRGRP, - resource->debugfs_res, resource, - &in_flight_summary_fops); + dentry = debugfs_create_file("in_flight_summary", 0440, + resource->debugfs_res, resource, + &in_flight_summary_fops); if (IS_ERR_OR_NULL(dentry)) goto fail; resource->debugfs_res_in_flight_summary = dentry; @@ -645,16 +645,16 @@ void drbd_debugfs_connection_add(struct drbd_connection *connection) goto fail; connection->debugfs_conn = dentry; - dentry = debugfs_create_file("callback_history", S_IRUSR|S_IRG...
2018 May 23
3
[PATCH] block drivers/block: Use octal not symbolic permissions
...bugfs_create_file("in_flight_summary", S_IRUSR|S_IRGRP, - resource->debugfs_res, resource, - &in_flight_summary_fops); + dentry = debugfs_create_file("in_flight_summary", 0440, + resource->debugfs_res, resource, + &in_flight_summary_fops); if (IS_ERR_OR_NULL(dentry)) goto fail; resource->debugfs_res_in_flight_summary = dentry; @@ -645,16 +645,16 @@ void drbd_debugfs_connection_add(struct drbd_connection *connection) goto fail; connection->debugfs_conn = dentry; - dentry = debugfs_create_file("callback_history", S_IRUSR|S_IRG...
2023 Nov 07
1
[bug report] drm/nouveau/gsp/r535: add support for booting GSP-RM
...7 *rpc; >> ???? 1014 >> ???? 1015???????? rpc = nvkm_gsp_rpc_get(gsp, NV_VGPU_MSG_FUNCTION_UNLOADING_GUEST_DRIVER, sizeof(*rpc)); >> >> nvkm_gsp_rpc_get() returns NULL on error. > > There are also code paths where it can return an ERR_PTR. I think we need to check for IS_ERR_OR_NULL()... Sorry, this is wrong, I just saw that r535_gsp_cmdq_get() calls r535_gsp_cmdq_get() which returns an ERR_PTR. Put it neither handles the return value of r535_gsp_cmdq_get() as ERR_PTR nor does it pass it through. > >> >> --> 1016???????? if (IS_ERR(rpc)) >> ???? 1017...
2013 Jul 19
4
[patch] virtio: console: fix error handling for debugfs_create_dir()
...vers/char/virtio_console.c index 1b456fe..ad2cd6d 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -2215,7 +2215,7 @@ static int __init init(void) } pdrvdata.debugfs_dir = debugfs_create_dir("virtio-ports", NULL); - if (!pdrvdata.debugfs_dir) { + if (IS_ERR_OR_NULL(pdrvdata.debugfs_dir)) { pr_warning("Error %ld creating debugfs dir for virtio-ports\n", PTR_ERR(pdrvdata.debugfs_dir)); }
2013 Jul 19
4
[patch] virtio: console: fix error handling for debugfs_create_dir()
...vers/char/virtio_console.c index 1b456fe..ad2cd6d 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -2215,7 +2215,7 @@ static int __init init(void) } pdrvdata.debugfs_dir = debugfs_create_dir("virtio-ports", NULL); - if (!pdrvdata.debugfs_dir) { + if (IS_ERR_OR_NULL(pdrvdata.debugfs_dir)) { pr_warning("Error %ld creating debugfs dir for virtio-ports\n", PTR_ERR(pdrvdata.debugfs_dir)); }
2014 Jan 07
10
[PATCH net-next v2 1/4] net: allow > 0 order atomic page alloc in skb_page_frag_refill
skb_page_frag_refill currently permits only order-0 page allocs unless GFP_WAIT is used. Change skb_page_frag_refill to attempt higher-order page allocations whether or not GFP_WAIT is used. If memory cannot be allocated, the allocator will fall back to successively smaller page allocs (down to order-0 page allocs). This change brings skb_page_frag_refill in line with the existing page allocation
2014 Jan 07
10
[PATCH net-next v2 1/4] net: allow > 0 order atomic page alloc in skb_page_frag_refill
skb_page_frag_refill currently permits only order-0 page allocs unless GFP_WAIT is used. Change skb_page_frag_refill to attempt higher-order page allocations whether or not GFP_WAIT is used. If memory cannot be allocated, the allocator will fall back to successively smaller page allocs (down to order-0 page allocs). This change brings skb_page_frag_refill in line with the existing page allocation
2020 Apr 26
1
[PATCH 1/2] vdpa: Support config interrupt in vhost_vdpa
...ULL; > + return PTR_ERR(v->config_ctx); > + } > + > + ctx = eventfd_ctx_fdget(file.fd); You may simply did ctx = f.fd == -1 ? NULL : eventfd_ctx_fdget(f.fd); Then there's no need for the specialized action for -1 above. > + swap(ctx, v->config_ctx); > + > + if (!IS_ERR_OR_NULL(ctx)) > + eventfd_ctx_put(ctx); > + > + if (IS_ERR(v->config_ctx)) > + return PTR_ERR(v->config_ctx); > + > + v->vdpa->config->set_config_cb(v->vdpa, &cb); > + > + return 0; > +} > static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsig...
2024 Jul 31
1
[PATCH 2/2] [v6] drm/nouveau: expose GSP-RM logging buffers via debugfs
...loginit debugfs entry could fail, but then creating logintr succeeds. > > > In fact, I think I found a small bug in dput(): > > > > void dput(struct dentry *dentry) > > { > > if (!dentry) > > return; > > > > This should probably be "if (IS_ERR_OR_NULL(dentry))". > > Yes, I agree, good catch. I will submit a separate patch for that.
2024 Jul 31
1
[PATCH 2/2] [v6] drm/nouveau: expose GSP-RM logging buffers via debugfs
...would return ERR_PTR(-ENOENT) if no entry was found. (This is where I was heading to in my previous reply.) > > In fact, I think I found a small bug in dput(): > > void dput(struct dentry *dentry) > { > if (!dentry) > return; > > This should probably be "if (IS_ERR_OR_NULL(dentry))". Yes, I agree, good catch. [1] https://elixir.bootlin.com/linux/v6.10/source/fs/debugfs/inode.c#L586
2020 Apr 26
3
[PATCH V2 1/2] vdpa: Support config interrupt in vhost_vdpa
...x *ctx; > + > + cb.callback = vhost_vdpa_config_cb; > + cb.private = v->vdpa; > + if (copy_from_user(&fd, argp, sizeof(fd))) > + return -EFAULT; > + > + ctx = fd == VHOST_FILE_UNBIND ? NULL : eventfd_ctx_fdget(fd); > + swap(ctx, v->config_ctx); > + > + if (!IS_ERR_OR_NULL(ctx)) > + eventfd_ctx_put(ctx); > + > + if (IS_ERR(v->config_ctx)) > + return PTR_ERR(v->config_ctx); > + > + v->vdpa->config->set_config_cb(v->vdpa, &cb); > + > + return 0; > +} > static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsig...
2020 Apr 26
3
[PATCH V2 1/2] vdpa: Support config interrupt in vhost_vdpa
...x *ctx; > + > + cb.callback = vhost_vdpa_config_cb; > + cb.private = v->vdpa; > + if (copy_from_user(&fd, argp, sizeof(fd))) > + return -EFAULT; > + > + ctx = fd == VHOST_FILE_UNBIND ? NULL : eventfd_ctx_fdget(fd); > + swap(ctx, v->config_ctx); > + > + if (!IS_ERR_OR_NULL(ctx)) > + eventfd_ctx_put(ctx); > + > + if (IS_ERR(v->config_ctx)) > + return PTR_ERR(v->config_ctx); > + > + v->vdpa->config->set_config_cb(v->vdpa, &cb); > + > + return 0; > +} > static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsig...
2020 Sep 04
1
[PATCH v3 2/6] iommu/virtio: Add topology helpers
...t; + * > + * Return: -EPROBE_DEFER if the device is managed by an IOMMU that hasn't been > + * probed yet, 0 otherwise > + */ > +int virt_dma_configure(struct device *dev) > +{ > + const struct iommu_ops *iommu_ops; > + > + iommu_ops = virt_iommu_setup(dev); > + if (IS_ERR_OR_NULL(iommu_ops)) { > + int ret = PTR_ERR(iommu_ops); > + > + if (ret == -EPROBE_DEFER || ret == 0) > + return ret; > + dev_err(dev, "error %d while setting up virt IOMMU\n", ret); > + return 0; why do we return 0 here? > + } > + > + /* > + * If we have reas...
2012 Dec 20
1
[PATCH] virtio_console: correct error message on failure of debugfs_create_dir
debugfs_create_dir() returns NULL if it fails, there's little point in calling PTR_ERR on it. Signed-off-by: Sasha Levin <sasha.levin at oracle.com> --- drivers/char/virtio_console.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index c594cb1..490b70e 100644 --- a/drivers/char/virtio_console.c
2012 Dec 20
1
[PATCH] virtio_console: correct error message on failure of debugfs_create_dir
debugfs_create_dir() returns NULL if it fails, there's little point in calling PTR_ERR on it. Signed-off-by: Sasha Levin <sasha.levin at oracle.com> --- drivers/char/virtio_console.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index c594cb1..490b70e 100644 --- a/drivers/char/virtio_console.c
2013 Oct 28
0
[PATCH] Btrfs: log recovery, don't unlink inode always on error
...5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index d75303e..2990fa4 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -1832,7 +1832,7 @@ again: dir_key->offset, name, name_len, 0); } - if (IS_ERR_OR_NULL(log_di)) { + if (!log_di || (IS_ERR(log_di) && PTR_ERR(log_di) == -ENOENT)) { btrfs_dir_item_key_to_cpu(eb, di, &location); btrfs_release_path(path); btrfs_release_path(log_path); @@ -1869,6 +1869,9 @@ again: goto again; ret = 0; goto out; + } else if (IS_ERR(...
2024 Jul 30
1
[PATCH 2/2] [v6] drm/nouveau: expose GSP-RM logging buffers via debugfs
...es, because a root of NULL is actually valid, and the entries are created in /sys/kernel/debug/0000:65:00.0/ instead of /sys/kernel/debug/dri/0000:65:00.0/ In fact, I think I found a small bug in dput(): void dput(struct dentry *dentry) { if (!dentry) return; This should probably be "if (IS_ERR_OR_NULL(dentry))".