[PATCH] drm/amd/display: delete unnecessary check in dcn35_set_long_vblank()

2024-03-16 Thread Dan Carpenter
"timing" is "&pipe_ctx[i]->stream->timing" where ->timing is not the first struct member of ->stream. So it's the address which points into the middle of a struct. It can't be NULL so delete the NULL check. Signed-off-by: Dan Carpenter

[PATCH] backlight: mp3309c: fix signedness bug in mp3309c_parse_fwnode()

2024-03-16 Thread Dan Carpenter
acklight: mp3309c: Make use of device properties") Signed-off-by: Dan Carpenter --- drivers/video/backlight/mp3309c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/backlight/mp3309c.c b/drivers/video/backlight/mp3309c.c index c80a1481e742..4e98e60417d2 1

Re: [PATCH v5 08/11] devm-helpers: Add resource managed version of debugfs directory create function

2024-03-25 Thread Dan Carpenter
NFIG_DEBUGFS is disabled. I have written a blog about this: https://staticthinking.wordpress.com/2023/07/24/debugfs-functions-are-not-supposed-to-be-checked/ regards, dan carpenter

Re: [PATCH 4/8] media: platform: ti: use for_each_endpoint_of_node()

2024-03-25 Thread Dan Carpenter
e end it has: of_node_put(endpoint); return pdata; Since endpoint is NULL this was always a pointless no-op but now it's more obvious, so lets delete that. regards, dan carpenter

[PATCH] drm/rockchip: Fix type promotion bug in rockchip_gem_iommu_map()

2023-10-11 Thread Dan Carpenter
reated as success. Add a cast to fix this. Fixes: 38f993b7c59e ("drm/rockchip: Do not use DMA mapping API if attached to IOMMU domain") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[bug report] drm/panfrost: Add support for devcoredump

2023-10-12 Thread Dan Carpenter
40 241 iter.hdr->bomap.valid = 1; 242 243 dump_header: panfrost_core_dump_header(&iter, PANFROSTDUMP_BUF_BO, iter.data + regards, dan carpenter

[bug report] drm/exynos/iommu: merge IOMMU and DMA code

2023-10-12 Thread Dan Carpenter
on this config... 122 priv->mapping = mapping; 123 } 124 125 return drm_iommu_attach_device(drm, dev, dma_priv); 126 } regards, dan carpenter

[PATCH] drm/msm: remove unnecessary NULL check

2023-10-13 Thread Dan Carpenter
/mdp5_kms.c:847 mdp5_init() warn: variable dereferenced before check 'mdp5_kms' (see line 782) Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b

[PATCH v2] drm/msm: remove unnecessary NULL check

2023-10-13 Thread Dan Carpenter
ine 782) Fixes: 1f50db2f3e1e ("drm/msm/mdp5: move resource allocation to the _probe function" Signed-off-by: Dan Carpenter --- v2: Added a Fixes tag. It's not really a bug fix and so adding the fixes tag is slightly unfair but it should prevent this patch from accidentally

Re: [PATCH] drm/msm: remove unnecessary NULL check

2023-10-13 Thread Dan Carpenter
On Fri, Oct 13, 2023 at 10:01:49AM +0200, Uwe Kleine-König wrote: > Hello, > > On Fri, Oct 13, 2023 at 10:17:08AM +0300, Dan Carpenter wrote: > > This NULL check was required when it was added, but we shuffled the code > > around in commit 1f50db2f3e1e ("drm/msm/mdp5

[PATCH] fbdev: omapfb: fix some error codes

2023-10-16 Thread Dan Carpenter
Return negative -ENXIO instead of positive ENXIO. Signed-off-by: Dan Carpenter --- No fixes tag because the caller doesn't check for errors. drivers/video/fbdev/omap/omapfb_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/omap/omapfb_main

Re: BUG: KASAN: slab-use-after-free in drm_connector_cleanup

2023-10-16 Thread Dan Carpenter
If I had to guess, I'd say it's an issue in the vc4_mock driver. It's crashing somewhere in Subtest: drm_vc4_test_pv_muxing. regards, dan carpenter On Fri, Oct 13, 2023 at 11:44:32PM +0530, Naresh Kamboju wrote: > Following kasan bug was noticed on arm64 bcm2711-rpi-4-b devi

[bug report] drm: Warn about negative sizes when calculating scale factor

2023-10-18 Thread Dan Carpenter
0 [ 1297.768452] bfe0: 0013 [ 1297.769652] ---[ end trace ]--- regards, dan carpenter

Re: [bug report] drm: Warn about negative sizes when calculating scale factor

2023-10-20 Thread Dan Carpenter
On Wed, Oct 18, 2023 at 05:17:42PM +0300, Dan Carpenter wrote: > drivers/gpu/drm/drm_rect.c >134 static int drm_calc_scale(int src, int dst) >135 { >136 int scale = 0; >137 >138 if (WARN_ON(

[bug report] drm/ssd130x: Add support for the SSD132x OLED controller family

2023-10-20 Thread Dan Carpenter
_format_info(DRM_FORMAT_R8); 931 if (!fi) regards, dan carpenter

Re: [bug report] drm: Warn about negative sizes when calculating scale factor

2023-10-20 Thread Dan Carpenter
On Fri, Oct 20, 2023 at 02:55:37PM +0300, Ville Syrjälä wrote: > On Fri, Oct 20, 2023 at 02:39:04PM +0300, Dan Carpenter wrote: > > On Wed, Oct 18, 2023 at 05:17:42PM +0300, Dan Carpenter wrote: > > > drivers/gpu/drm/drm_rect.c > > >134 static int drm_calc_scale(int

Re: [PATCH] vga_switcheroo: Fix impossible judgment condition

2023-10-25 Thread Dan Carpenter
ck for. It honestly might be good to check for both... if ((int)id < 0 || id == VGA_SWITCHEROO_UNKNOWN_ID) { mutex_unlock(&vgasr_mutex); return -EINVAL; } regards, dan carpenter

Re: [PATCH] vga_switcheroo: Fix impossible judgment condition

2023-10-26 Thread Dan Carpenter
On Thu, Oct 26, 2023 at 04:46:29PM +0800, Su Hui wrote: > On 2023/10/26 12:44, Dan Carpenter wrote: > > On Thu, Oct 26, 2023 at 10:10:57AM +0800, Su Hui wrote: > > > 'id' is enum type like unsigned int, so it will never be less than zero. > > > > >

Re: [PATCH v2] vga_switcheroo: Fix impossible judgment condition

2023-10-26 Thread Dan Carpenter
> GPU id") > Signed-off-by: Su Hui > --- > v2: > - add check of VGA_SWITCHEROO_UNKNOWN_ID(Dan's suggestion). > > By the way, all functions of 'get_client_id' will never return error code > or VGA_SWITCHEROO_UNKNOWN_ID,should we remove this check or

[PATCH 1/2] fbdev/imsttfb: fix double free in probe()

2023-10-27 Thread Dan Carpenter
The init_imstt() function calls framebuffer_release() on error and then the probe() function calls it again. It should only be done in probe. Fixes: 518ecb6a209f ("fbdev: imsttfb: Fix error path of imsttfb_probe()") Signed-off-by: Dan Carpenter --- drivers/video/fbdev/imsttfb.c | 6

[PATCH 2/2] fbdev/imsttfb: fix a resource leak in probe

2023-10-27 Thread Dan Carpenter
I've re-written the error handling but the bug is that if init_imstt() fails we need to call iounmap(par->cmap_regs). Fixes: c75f5a550610 ("fbdev: imsttfb: Fix use after free bug in imsttfb_probe") Signed-off-by: Dan Carpenter --- drivers/video/fb

Re: [bug report] drm: Warn about negative sizes when calculating scale factor

2023-10-27 Thread Dan Carpenter
On Fri, Oct 20, 2023 at 05:11:24PM +0300, Dan Carpenter wrote: > On Fri, Oct 20, 2023 at 02:55:37PM +0300, Ville Syrjälä wrote: > > On Fri, Oct 20, 2023 at 02:39:04PM +0300, Dan Carpenter wrote: > > > On Wed, Oct 18, 2023 at 05:17:42PM +0300, Dan Carpenter wrote: > > > &

Re: [PATCH 2/2] media: imx: vdic: Introduce mem2mem VDI deinterlacer driver

2024-07-13 Thread Dan Carpenter
= ipu_id; > + priv->ipu_dev = md->ipu[ipu_id]; > + priv->dev = md->md.dev; > + > + mutex_init(&priv->mutex); > + > + vfd = video_device_alloc(); > + if (!vfd) { > + ret = -ENOMEM; > + goto err_vfd; > + } > + > + *vfd = mem2mem_template; > + vfd->lock = &priv->mutex; > + priv->vdev.vfd = vfd; > + > + INIT_LIST_HEAD(&priv->vdev.list); > + spin_lock_init(&priv->irqlock); > + atomic_set(&priv->stream_count, 0); > + > + video_set_drvdata(vfd, priv); > + > + priv->m2m_dev = v4l2_m2m_init(&m2m_ops); > + if (IS_ERR(priv->m2m_dev)) { > + ret = PTR_ERR(priv->m2m_dev); > + v4l2_err(&md->v4l2_dev, "Failed to init mem2mem device: %d\n", > + ret); > + goto err_m2m; > + } > + > + /* Reset formats */ > + priv->fmt[V4L2_M2M_SRC] = ipu_mem2mem_vdic_default; > + priv->fmt[V4L2_M2M_SRC].pixelformat = V4L2_PIX_FMT_YUV420; > + priv->fmt[V4L2_M2M_SRC].field = V4L2_FIELD_SEQ_TB; > + priv->fmt[V4L2_M2M_SRC].bytesperline = DEFAULT_WIDTH; > + priv->fmt[V4L2_M2M_SRC].sizeimage = DEFAULT_WIDTH * DEFAULT_HEIGHT * 3 > / 2; > + > + priv->fmt[V4L2_M2M_DST] = ipu_mem2mem_vdic_default; > + priv->fmt[V4L2_M2M_DST].pixelformat = V4L2_PIX_FMT_RGB565; > + priv->fmt[V4L2_M2M_DST].field = V4L2_FIELD_NONE; > + priv->fmt[V4L2_M2M_DST].bytesperline = DEFAULT_WIDTH * 2; > + priv->fmt[V4L2_M2M_DST].sizeimage = DEFAULT_WIDTH * DEFAULT_HEIGHT * 2; > + > + return &priv->vdev; > + > +err_m2m: > + video_set_drvdata(vfd, NULL); video_device_release(vfd) regards, dan carpenter > +err_vfd: > + kfree(priv); > + return ERR_PTR(ret); > +}

[bug report] drm/vc4: Add CTM support

2024-07-19 Thread Dan Carpenter
(63); 559 if (val > BIT_ULL(32)) 560 return -EINVAL; 561 } 562 563 ctm_state->fifo = fifo; 564 ctm_state->ctm = ctm; 565 } 566 } 567 568 return 0; 569 } regards, dan carpenter

[bug report] drm/v3d: Create a CPU job extension for the reset timestamp job

2024-07-23 Thread Dan Carpenter
563 } 564 job->timestamp_query.count = reset.count; 565 566 return 0; 567 568 error: 569 v3d_timestamp_query_info_free(&job->timestamp_query, i); 570 return err; 571 } regards, dan carpenter

[bug report] accel/habanalabs: enforce release order of compute device and dma-buf

2024-07-24 Thread Dan Carpenter
^^^ Potential use after free 1845 1846 kfree(hl_dmabuf); 1847 } regards, dan carpenter

[PATCH] drm/client: Fix error code in drm_client_buffer_vmap_local()

2024-07-24 Thread Dan Carpenter
This function accidentally returns zero/success on the failure path. It leads to locking issues and an uninitialized *map_copy in the caller. Fixes: b4b0193e83cb ("drm/fbdev-generic: Fix locking with drm_client_buffer_vmap_local()") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/dr

Re: [PATCH v2 2/2] media: imx: vdic: Introduce mem2mem VDI deinterlacer driver

2024-07-24 Thread Dan Carpenter
meter is optional. strscpy(cap->driver, "imx-m2m-vdic"); strscpy(cap->card, "imx-m2m-vdic"); strscpy(cap->bus_info, "platform:imx-m2m-vdic"); Shazaaam! Magic! > + cap->device_caps = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING; > + cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; > + > + return 0; > +} regards, dan carpenter

Re: [bug report] accel/habanalabs: enforce release order of compute device and dma-buf

2024-07-25 Thread Dan Carpenter
On Thu, Jul 25, 2024 at 08:21:51AM +, Tomer Tayar wrote: > On 24/07/2024 19:08, Dan Carpenter wrote: > > Hello Tomer Tayar, > > > > Commit 09524eb8824e ("accel/habanalabs: enforce release order of > > compute device and dma-buf") from Jan 22, 2023 (li

Re: [bug report] accel/habanalabs: enforce release order of compute device and dma-buf

2024-07-26 Thread Dan Carpenter
s, Tomer A comment would be grand. Thanks! regards, dan carpenter

[PATCH] drm/plane: Fix IS_ERR() vs NULL bug

2024-07-26 Thread Dan Carpenter
The drm_property_create_signed_range() function returns NULL on error, it doesn't return error pointers. Change the IS_ERR() tests to check for NULL. Fixes: 8f7179a1027d ("drm/atomic: Add support for mouse hotspots") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/drm_plane.c

Re: [PATCH v2] drm/amd/amdgpu: Properly tune the size of struct

2024-07-29 Thread Dan Carpenter
gpu: Update VF2PF interface") > Signed-off-by: Su Hui > Signed-off-by: Dan Carpenter > Signed-off-by: wenlunpeng > Signed-off-by: WangYuli > --- Thanks for doing this, but these Signed-off-by tags aren't correct. Signed-off-by is like signing a legal document. It came

Re: [PATCH] fbdev/hpfb: Fix an error handling path in hpfb_dio_probe()

2024-07-29 Thread Dan Carpenter
omeone still has such a machine :-) > It surprised me how many patches we backport for ancient stuff. But I guess the risk/reward equation still works because if the code isn't used there the risk is very small. regards, dan carpenter

Re: [PATCH] fbdev/hpfb: Fix an error handling path in hpfb_dio_probe()

2024-07-29 Thread Dan Carpenter
On Mon, Jul 29, 2024 at 10:09:39PM +0200, Helge Deller wrote: > On 7/29/24 17:59, Dan Carpenter wrote: > > On Mon, Jul 29, 2024 at 10:13:17AM +0200, Helge Deller wrote: > > > On 7/28/24 20:29, Christophe JAILLET wrote: > > > > If an error occurs after request

[bug report] drm/omap: gem: Replace struct_mutex usage with omap_obj private lock

2024-07-30 Thread Dan Carpenter
goto done; So I think we can just return directly instead of unlocking. 1431 } 1432 } 1433 1434 done: --> 1435 mutex_unlock(&omap_obj->lock); 1436 return obj; 1437 } regards, dan carpenter

Re: [PATCH] staging: vme_user: vme_bridge.h: Document mutex in vme_dma_resource structure

2024-08-02 Thread Dan Carpenter
idge.h > +++ b/drivers/staging/vme_user/vme_bridge.h > @@ -61,6 +61,7 @@ struct vme_dma_list { > struct vme_dma_resource { > struct list_head list; > struct vme_bridge *parent; > + /* Mutex to protect DMA controller resources and ensure thread-safe > operations */ "resources" is too vague. "ensure thread-safe operations" is obvious and doesn't need to be said. regards, dan carpenter

[PATCH] drm/ast: astdp: fix pre-op vs post-op bug

2024-08-09 Thread Dan Carpenter
obably that's okay. Fixes: 2281475168d2 ("drm/ast: astdp: Perform link training during atomic_enable") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/ast/ast_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ast/ast_dp.c b/drivers/gpu/drm/ast

Re: [PATCH] fbdev: omapfb: panel-sony-acx565akm: Simplify show_cabc_available_modes()

2024-08-09 Thread Dan Carpenter
gt; + buf[len - 1] = '\n'; I'm uncomfortable with this line. It assumes we don't overflow PAGE_SIZE where the original code was careful about checking. Probably easiest to do what the original code did and say: for (i = 0; i < ARRAY_SIZE(cabc_modes); i++) len += sysfs_emit_at(buf, len, "%s%s", cabc_modes[i], i == ARRAY_SIZE(cabc_modes) - 1 ? "\n" : ""); regards, dan carpenter

Re: [PATCH] fbdev: omapfb: panel-sony-acx565akm: Simplify show_cabc_available_modes()

2024-08-09 Thread Dan Carpenter
On Fri, Aug 09, 2024 at 05:42:32PM +0300, Dan Carpenter wrote: > On Thu, Aug 08, 2024 at 11:46:11AM +0200, Christophe JAILLET wrote: > > Use sysfs_emit_at() instead of snprintf() + custom logic. > > Using sysfs_emit_at() is much more simple. > > > > Also, sysfs_emi

Re: [PATCH] fbdev: omapfb: panel-sony-acx565akm: Simplify show_cabc_available_modes()

2024-08-09 Thread Dan Carpenter
On Fri, Aug 09, 2024 at 05:09:28PM +0200, Christophe JAILLET wrote: > Le 09/08/2024 à 16:42, Dan Carpenter a écrit : > > On Thu, Aug 08, 2024 at 11:46:11AM +0200, Christophe JAILLET wrote: > > > Use sysfs_emit_at() instead of snprintf() + custom logic. > > > Using s

Re: [PATCH] drm/ast: astdp: fix pre-op vs post-op bug

2024-08-09 Thread Dan Carpenter
On Fri, Aug 09, 2024 at 04:43:51PM +0300, Jani Nikula wrote: > On Fri, 09 Aug 2024, Thomas Zimmermann wrote: > > Hi, > > > > thanks a lot for the bugfix. > > > > Am 09.08.24 um 14:33 schrieb Dan Carpenter: > >> The test for "Link training failed&quo

[PATCH v2] drm/ast: astdp: fix loop timeout check

2024-08-11 Thread Dan Carpenter
Fixes: 2281475168d2 ("drm/ast: astdp: Perform link training during atomic_enable") Signed-off-by: Dan Carpenter --- v2: In version one, I introduced a bug where it would msleep(100) after failure and that is a pointless thing to do. Also change the loop to a for loop. --- dri

Re: [PATCH v2] drm/ast: astdp: fix loop timeout check

2024-08-11 Thread Dan Carpenter
On Mon, Aug 12, 2024 at 09:42:53AM +0300, Dan Carpenter wrote: > This code has an issue because it loops until "i" is set to UINT_MAX but > the test for failure assumes that "i" is set to zero. The result is that > it will only print an error message if we succeed on

Re: [PATCH v2] drm/ast: astdp: fix loop timeout check

2024-08-11 Thread Dan Carpenter
On Mon, Aug 12, 2024 at 08:48:16AM +0200, Thomas Zimmermann wrote: > Hi > > Am 12.08.24 um 08:42 schrieb Dan Carpenter: > > This code has an issue because it loops until "i" is set to UINT_MAX but > > the test for failure assumes that "i" is set to zero.

Re: [PATCH v2] drm/ast: astdp: fix loop timeout check

2024-08-12 Thread Dan Carpenter
aining ultimately fails, the rest of DRM > keeps running. 100 msec is not so short to shrug it off IMHO. > Sure. No problem. regards, dan carpenter

[PATCH v3] drm/ast: astdp: fix loop timeout check

2024-08-12 Thread Dan Carpenter
Fixes: 2281475168d2 ("drm/ast: astdp: Perform link training during atomic_enable") Signed-off-by: Dan Carpenter --- v3: V2 had the same bug but just without the always true if (i) statement. Remove the final sleep. v2: In V1, I introduced a bug where it would msleep(100) after failu

Re: [PATCH] staging: vme_user: vme_bridge.h: Document mutex in vme_dma_resource structure

2024-08-14 Thread Dan Carpenter
d. Trying to figure out the locking is a good exercise. It wouldn't surprise me if there were some locking bugs in this code and you should try to fix those. But it's not super easy either. regards, dan carpenter

[bug report] accel/ivpu: Add GEM buffer object management

2024-08-19 Thread Dan Carpenter
lead to a NULL dereference ahead of time. 120 121 ivpu_dbg(vdev, KREF, "file_priv put: ctx %u refcount %u\n", regards, dan carpenter

[PATCH] nouveau/u_memcpya: fix NULL vs error pointer bug

2023-09-15 Thread Dan Carpenter
The u_memcpya() function is supposed to return error pointers on error. Returning NULL will lead to an Oops. Fixes: 68132cc6d1bc ("nouveau/u_memcpya: use vmemdup_user") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/nouveau/nouveau_drv.h | 2 +- 1 file changed, 1 insertion(+),

[PATCH] drm/msm/dsi: fix irq_of_parse_and_map() error checking

2023-09-15 Thread Dan Carpenter
The irq_of_parse_and_map() function returns zero on error. It never returns negative error codes. Fix the check. Fixes: a689554ba6ed ("drm/msm: Initial add DSI connector support") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/dsi/dsi_host.c | 7 +++ 1 file changed, 3

Re: [Nouveau] [PATCH] nouveau/u_memcpya: fix NULL vs error pointer bug

2023-09-16 Thread Dan Carpenter
On Sat, Sep 16, 2023 at 01:41:43AM +0200, Danilo Krummrich wrote: > Hi Dan, > > On 9/15/23 14:59, Dan Carpenter wrote: > > The u_memcpya() function is supposed to return error pointers on > > error. Returning NULL will lead to an Oops. > > > > Fixes: 6813

Re: [Nouveau] [PATCH] nouveau/u_memcpya: fix NULL vs error pointer bug

2023-09-16 Thread Dan Carpenter
On Sat, Sep 16, 2023 at 05:24:04PM +0300, Dan Carpenter wrote: > On Sat, Sep 16, 2023 at 01:41:43AM +0200, Danilo Krummrich wrote: > > Hi Dan, > > > > On 9/15/23 14:59, Dan Carpenter wrote: > > > The u_memcpya() function is supposed to return error pointers on >

Re: [PATCH v2 1/5] string.h: add array-wrappers for (v)memdup_user()

2023-09-16 Thread Dan Carpenter
ERR_PTR(-EOVERFLOW); No need for an unlikely() because check_mul_overflow() already has one inside. I feel like -ENOMEM is more traditional but I doubt anyone/userspace cares. > + > + return memdup_user(src, nbytes); > +} regards, dan carpenter

[PATCH] dma-buf: heaps: Fix off by one in cma_heap_vm_fault()

2023-10-02 Thread Dan Carpenter
helper logic into the cma_heap implementation") Signed-off-by: Dan Carpenter --- drivers/dma-buf/heaps/cma_heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c index ee899f8e6721..bea7e574f916 100644 --- a/dri

Re: [PATCH] dma-buf: heaps: Fix off by one in cma_heap_vm_fault()

2023-10-03 Thread Dan Carpenter
On Mon, Oct 02, 2023 at 10:16:24AM -0700, T.J. Mercier wrote: > On Mon, Oct 2, 2023 at 12:04 AM Dan Carpenter > wrote: > > > > The buffer->pages[] has "buffer->pagecount" elements so this > comparison > > has to be changed to >= to avoid reading beyo

[RFC] drm/tests: annotate intentional stack trace in drm_test_rect_calc_hscale()

2023-10-30 Thread Dan Carpenter
onal warning finished\n" message at the end. I haven't actually tested this patch... Daniel, do you have a list of intentional stack traces we could annotate? Signed-off-by: Dan Carpenter --- drivers/gpu/drm/tests/drm_rect_test.c | 2 ++ include/kunit/test.h | 3 +++

Re: [RFC] drm/tests: annotate intentional stack trace in drm_test_rect_calc_hscale()

2023-11-01 Thread Dan Carpenter
Let me add Richard to the CC list. See lore for more details. https://lore.kernel.org/all/CA+G9fYuA643RHHpPnz9Ww7rr3zV5a0y=7_uFcybBSL=qp_s...@mail.gmail.com/ On Tue, Oct 31, 2023 at 09:57:48PM +0530, Naresh Kamboju wrote: > On Mon, 30 Oct 2023 at 14:33, Dan Carpenter wrote: > > &g

[PATCH] drm/rect: only print the stack trace in drm_calc_scale() once

2023-11-02 Thread Dan Carpenter
://lore.kernel.org/all/CA+G9fYuA643RHHpPnz9Ww7rr3zV5a0y=7_uFcybBSL=qp_s...@mail.gmail.com/ Signed-off-by: Dan Carpenter --- drivers/gpu/drm/drm_rect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c index 85c79a38c13a

[PATCH] nouveau/gsp/r535: uninitialized variable in r535_gsp_acpi_mux_id()

2023-11-07 Thread Dan Carpenter
The if we hit the "continue" statement on the first iteration through the loop then "handle_mux" needs to be set to NULL so we continue looping. Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM") Signed-off-by: Dan Carpenter --- drivers/g

[PATCH] nouveau/gsp/r535: Fix a NULL vs error pointer bug

2023-11-07 Thread Dan Carpenter
t for booting GSP-RM") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c index e31f9641114b..f8

Re: [RFC] drm/tests: annotate intentional stack trace in drm_test_rect_calc_hscale()

2023-11-15 Thread Dan Carpenter
now I know to look for WARN(), lockdep, and KASAN. What other bugs formats do we have? Probably someone like the syzbot devs have already has written a script like this? regards, dan carpenter

Re: [PATCH 16/28] drm/i915/color: Create a transfer function color pipeline

2024-02-18 Thread Dan Carpenter
| Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202402180310.gmdixajx-...@intel.com/ New smatch warnings: drivers/gpu/drm/i915/display/intel_color.c:3867 intel_plane_tf_pipeline_init() error: 'colorop' dereferencing possible ERR_PTR() vim +/colorop +3867 drivers/gp

Re: [PATCH v2] udmabuf: Fix a potential (and unlikely) access to unallocated memory

2024-02-19 Thread Dan Carpenter
t high enough to lead to an integer overflow then you kind of deserve what you get. This patch is nice for kernel hardening and making the code easier to read/audit but the real world security impact is negligible. regards, dan carpenter

Re: [PATCH v2] udmabuf: Fix a potential (and unlikely) access to unallocated memory

2024-02-19 Thread Dan Carpenter
On Mon, Feb 19, 2024 at 06:59:02PM +0100, Christophe JAILLET wrote: > Le 19/02/2024 à 09:37, Dan Carpenter a écrit : > > On Sun, Feb 18, 2024 at 06:46:44PM +0100, Christophe JAILLET wrote: > > > If 'list_limit' is set to a very high value, 'lsize' computati

Re: [PATCH] staging: fbtft: Fix "space prohibited before that close parenthesis ')'" error reported by checkpatch

2024-02-21 Thread Dan Carpenter
efore that > close parenthesis ')'". > > Signed-off-by: Kyoji Ogasawara This breaks the build. You could do a search for it. https://lore.kernel.org/all/?q=define_fbtft_write_reg regards, dan carpenter

Re: [PATCH] soc: qcom: pmic_glink_altmode: Use common error handling code in pmic_glink_altmode_probe()

2024-02-28 Thread Dan Carpenter
d yet and it would need a bit of adjusting for this use case but it's basically what you want. regards, dan carpenter

Re: [PATCH next 10/11] block: Use a boolean expression instead of max() on booleans

2024-01-29 Thread Dan Carpenter
> > > These are bool, so it is just a bitwise or. > > > > Should be a logical or, really. And || in code. > > Not really, bitwise is fine for bool (especially for 'or') > and generates better code. For | vs || the type doesn't make a difference... It makes a difference for AND. "0x1 & 0x10" vs "0x1 && 0x10". regards, dan carpenter

[PATCH] drm/imagination: Fix an IS_ERR vs NULL bug in pvr_context_create()

2024-02-01 Thread Dan Carpenter
The pvr_vm_context_lookup() function returns NULL on error (not error pointers). Update the check accordingly. Fixes: d2d79d29bb98 ("drm/imagination: Implement context creation/destruction ioctls") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/imagination/pvr_context.c | 4 ++

[bug report] drm/bridge: imx: add driver for HDMI TX Parallel Video Interface

2024-02-07 Thread Dan Carpenter
>input_bus_flags; 81 else if (bridge_state) This check for NULL is too late. Hopefully it can it be removed? 82 bus_flags = bridge_state->input_bus_cfg.flags; 83 regards, dan carpenter

[PATCH] drm/amd/display: Fix && vs || typos

2024-02-09 Thread Dan Carpenter
These ANDs should be ORs or it will lead to a NULL dereference. Fixes: fb5a3d037082 ("drm/amd/display: Add NULL test for 'timing generator' in 'dcn21_set_pipe()'") Fixes: 886571d217d7 ("drm/amd/display: Fix 'panel_cntl' could be null in '

[PATCH] drm/imx/dcss: fix resource size calculation

2024-02-13 Thread Dan Carpenter
The resource is inclusive of the ->start and ->end addresses so this calculation is not correct. It should be "res->end - res->start + 1". Use the resource_size() to do the calculation. Fixes: 90393c9b5408 ("drm/imx/dcss: request memory region") Signed-off-by:

[PATCH] drm/nouveau/mmu/r535: uninitialized variable in r535_bar_new_()

2024-02-13 Thread Dan Carpenter
If gf100_bar_new_() fails then "bar" is not initialized. Fixes: 5bf0257136a2 ("drm/nouveau/mmu/r535: initial support") Signed-off-by: Dan Carpenter --- It looks like this was intended to handle a failure from the "rm" func but "rm" can't actually fa

Re: [PATCH v2 resend 2/8] hwtracing: use for_each_endpoint_of_node()

2024-05-29 Thread Dan Carpenter
r_each_endpoint_of_node_scoped(). #define for_each_endpoint_of_node_scoped(parent, child) \ for (struct device_node *child __free(device_node) = \ of_graph_get_next_endpoint(parent, NULL); child != NULL; \ child = of_graph_get_next_endpoint(parent, child)) regards, dan carpenter

Re: [PATCH v2 resend 2/8] hwtracing: use for_each_endpoint_of_node()

2024-05-29 Thread Dan Carpenter
On Wed, May 29, 2024 at 05:52:53PM +0300, Laurent Pinchart wrote: > On Wed, May 29, 2024 at 05:34:41PM +0300, Dan Carpenter wrote: > > On Wed, May 29, 2024 at 03:40:47AM +0300, Laurent Pinchart wrote: > > > > @@ -286,7 +286,7 @@ static int of_get_coresight_platform_data(struct

Re: [Freedreno] [PATCH v2] drm/msm: remove unnecessary NULL check

2023-11-20 Thread Dan Carpenter
On Thu, Nov 16, 2023 at 01:05:52PM -0800, Abhinav Kumar wrote: > > > On 11/1/2023 12:23 PM, Abhinav Kumar wrote: > > > > > > On 10/13/2023 1:25 AM, Dan Carpenter wrote: > > > This NULL check was required when it was added, but we shuffled the code

[PATCH] nouveau/gsp/r535: remove a stray unlock in r535_gsp_rpc_send()

2023-11-27 Thread Dan Carpenter
This unlock doesn't belong here and it leads to a double unlock in the caller, r535_gsp_rpc_push(). Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 4 +--- 1 file chang

[bug report] backlight: mp3309c: Add support for MPS MP3309C

2023-11-27 Thread Dan Carpenter
92 if (ret) 293 pdata->default_brightness = pdata->max_brightness; 294 if (pdata->default_brightness > pdata->max_brightness) { 295 dev_err(chip->dev, 296 "default brightness exceeds max brightness\n"); 297 pdata->default_brightness = pdata->max_brightness; 298 } 299 300 /* regards, dan carpenter

Re: [bug report] backlight: mp3309c: Add support for MPS MP3309C

2023-11-29 Thread Dan Carpenter
On Wed, Nov 29, 2023 at 11:12:29AM +, Flavio Suligoi wrote: > Hi Dan, > > Can I add the "Reported-by" tag, with your name, in my 2nd vers of > the commit to fix this bug? Yeah. Thanks! If the bug report is sent to a public mailing list then there is no need to ask. regards, dan carpenter

[PATCH 1/2] drm/imagination: Fix error codes in pvr_device_clk_init()

2023-11-29 Thread Dan Carpenter
There is a cut and paste error so this code returns the wrong variable. Fixes: 1f88f017e649 ("drm/imagination: Get GPU resources") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/imagination/pvr_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drive

[PATCH 2/2] drm/imagination: Fix IS_ERR() vs NULL bug in pvr_request_firmware()

2023-11-29 Thread Dan Carpenter
The pvr_build_firmware_filename() function returns NULL on error. It doesn't return error pointers. Fixes: f99f5f3ea7ef ("drm/imagination: Add GPU ID parsing and firmware loading") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/imagination/pvr_device.c | 4 ++-- 1 file change

[bug report] drm/imagination: Implement firmware infrastructure and META FW support

2023-11-29 Thread Dan Carpenter
& ~ROGUE_CR_MTS_SCHEDULE_DM_CLRMSK); ^^ PVR_FWIF_DM_GP is zero. 278 279 out_unlock: 280 mutex_unlock(&pvr_ccb->lock); 281 } regards, dan carpenter

[PATCH] drm/imagination: fix off by one in pvr_vm_mips_init() error handling

2023-11-29 Thread Dan Carpenter
0). At that point we know that all the elements thus far are initialized so we don't need to have NULL checks. Fixes: 927f3e0253c1 ("drm/imagination: Implement MIPS firmware processor and MMU support") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/imagination/pvr_vm_mips.c |

[PATCH] drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking

2023-12-04 Thread Dan Carpenter
send/receive then we should return a negative error code but this code returns success. Fixes: a9fe713d7d45 ("drm/bridge: Add PTN3460 bridge driver") Cc: sta...@vger.kernel.org Signed-off-by: Dan Carpenter --- This is from static analysis and code review. It's always a conce

[bug report] drm/amdgpu: Workaround to skip kiq ring test during ras gpu recovery

2023-12-04 Thread Dan Carpenter
ery)) { 543 spin_unlock(&kiq->ring_lock); 544 return 0; 545 } 546 547 if (kiq_ring->sched.ready && !adev->job_hang) 548 r = amdgpu_ring_test_helper(kiq_ring); 549 spin_unlock(&kiq->ring_lock); regards, dan carpenter

Re: [PATCH] drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking

2023-12-04 Thread Dan Carpenter
On Mon, Dec 04, 2023 at 02:53:05PM +0100, Neil Armstrong wrote: > On 04/12/2023 13:29, Dan Carpenter wrote: > > The i2c_master_send/recv() functions return negative error codes or the > > number of bytes that were able to be sent/received. This code has > > two problems. 1)

Re: Kunit drm_test_check_plane_state: EXPECTATION FAILED at drivers/gpu/drm/tests/drm_plane_helper_test.c:123

2023-12-05 Thread Dan Carpenter
rday for some > unrelated reason, so it should be fixed in next-20231205 onward. Sorry, that's a bummer that these patches were reverted. :( The whole episode was a bit unfortunate... Qualcom has been working on those patches for a year. They must not be using kunit testing as part of their QC... It's some kind of communication failure on our part. Hopefully we can get this all sorted out and re-apply the patches soon. regards, dan carpenter

Re: [PATCH] drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking

2023-12-05 Thread Dan Carpenter
On Tue, Dec 05, 2023 at 02:48:26PM +0100, Robert Foss wrote: > On Mon, 4 Dec 2023 15:29:00 +0300, Dan Carpenter wrote: > > The i2c_master_send/recv() functions return negative error codes or the > > number of bytes that were able to be sent/received. This code has > > two p

Re: [PATCH] drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking

2023-12-05 Thread Dan Carpenter
On Tue, Dec 05, 2023 at 03:04:49PM +0100, Robert Foss wrote: > On Tue, Dec 5, 2023, 15:01 Dan Carpenter wrote: > > > On Tue, Dec 05, 2023 at 02:48:26PM +0100, Robert Foss wrote: > > > On Mon, 4 Dec 2023 15:29:00 +0300, Dan Carpenter wrote: > > > > The i2c_ma

[PATCH] drm/panthor: Fix error code in panthor_gpu_init()

2024-04-02 Thread Dan Carpenter
ge <= to < 0. Fixes: 5cd894e258c4 ("drm/panthor: Add the GPU logical block") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/panthor/panthor_gpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/pant

[PATCH] drm/panthor: Fix off by one in panthor_fw_get_cs_iface()

2024-04-02 Thread Dan Carpenter
The ->iface.streams[csg_slot][] array has MAX_CS_PER_CSG elements so this > comparison needs to be >= to prevent an out of bounds access. Fixes: 2718d91816ee ("drm/panthor: Add the FW logical block") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/panthor/panthor_fw.c | 2 +-

[PATCH] drm/panthor: Fix a couple -ENOMEM error codes

2024-04-02 Thread Dan Carpenter
These error paths forgot to set the error code to -ENOMEM. Fixes: 647810ec2476 ("drm/panthor: Add the MMU/VM logical block") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/panthor/panthor_mmu.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/d

Re: [PATCH v3] drm/panthor: Fix couple of NULL vs IS_ERR() bugs

2024-04-02 Thread Dan Carpenter
4bdca1150792 ("drm/panthor: Add the driver frontend block") > > I would explain that the code was correct, but the documentation didn't > match the function behavior, otherwise it feels a bit weird to have a > Fixes tag here. The code wasn't correct, it returned a mix of error pointers and NULL. So it needs a Fixes tag. regards, dan carpenter

Re: [PATCH v3] drm/panthor: Fix couple of NULL vs IS_ERR() bugs

2024-04-02 Thread Dan Carpenter
On Tue, Apr 02, 2024 at 05:19:25PM +0200, Boris Brezillon wrote: > On Tue, 2 Apr 2024 17:44:18 +0300 > Dan Carpenter wrote: > > > On Tue, Apr 02, 2024 at 04:38:38PM +0200, Boris Brezillon wrote: > > > On Tue, 2 Apr 2024 07:14:11 -0700 > > > Harshit Mogalapalli

Re: [PATCH v5 02/10] PCI: Deprecate iomap-table functions

2024-04-03 Thread Dan Carpenter
.qixhnemu-...@intel.com/config) compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r

[PATCH] drm: xlnx: db: fix a memory leak in probe

2024-04-04 Thread Dan Carpenter
Free "dp" before returning. Fixes: be318d01a903 ("drm: xlnx: dp: Reset DisplayPort IP") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xl

Re: [PATCH 7/7] drm/udl: Remove struct udl_connector

2024-04-04 Thread Dan Carpenter
/202404051359.y6aguwfi-...@intel.com/config) compiler: hppa-linux-gcc (GCC) 13.2.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https

[bug report] drm/panthor: Add the scheduler logical block

2024-04-08 Thread Dan Carpenter
cs_slot_reset_locked(ptdev, csg_id, i); 1171 } 1172 } 1173 1174 group->state = new_state; 1175 } regards, dan carpenter

[PATCH] drm/panthor: clean up some types in panthor_sched_suspend()

2024-04-08 Thread Dan Carpenter
ars out the top 32 bits which would likely be a bug if anything were stored there. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/panthor/panthor_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panth

Re: [bug report] drm/panthor: Add the scheduler logical block

2024-04-10 Thread Dan Carpenter
On Wed, Apr 10, 2024 at 03:11:52PM +0100, Steven Price wrote: > On 08/04/2024 08:35, Dan Carpenter wrote: > > Hello Boris Brezillon, > > > > Commit de8548813824 ("drm/panthor: Add the scheduler logical block") > > from Feb 29, 2024 (linux-next), leads to th

[bug report] drm: bridge: cdns-mhdp8546: Fix possible null pointer dereference

2024-04-11 Thread Dan Carpenter
lock before returning. 2064 2065 drm_mode_set_name(mhdp_state->current_mode); 2066 2067 dev_dbg(mhdp->dev, "%s: Enabling mode %s\n", __func__, mode->name); 2068 2069 mhdp->bridge_enabled = true; 2070 2071 out: 2072 mutex_unlock(&mhdp->link_mutex); 2073 if (ret < 0) --> 2074 schedule_work(&mhdp->modeset_retry_work); 2075 } regards, dan carpenter

<    5   6   7   8   9   10   11   12   13   14   >