Re: [PATCH] drm/amdgpu/userq: remove unnecessary NULL check

2025-04-30 Thread Dan Carpenter
On Wed, Apr 30, 2025 at 09:28:59AM +, Sharma, Shashank wrote: > [AMD Official Use Only - AMD Internal Distribution Only] > > Hello Dan, > > ________ > From: Dan Carpenter > Sent: Wednesday, April 30, 2025 10:05 AM > To: Deucher, Alexander

[PATCH] drm/nouveau/fifo: small cleanup in nvkm_chan_cctx_get()

2025-04-30 Thread Dan Carpenter
"&chan->cgrp->mutex" and "&cgrp->mutex" are the same thing. Use "&cgrp->mutex" consistently. It looks nicer and it silences a Smatch static checker warning. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/nouveau/nvkm/engine/fifo/cha

[PATCH] drm/amdgpu/userq: remove unnecessary NULL check

2025-04-30 Thread Dan Carpenter
The "ticket" pointer points to in the middle of the &exec struct so it can't be NULL. Remove the check. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgp

[PATCH next] drm/st7571-i2c: Fix IS_ERR() vs NULL checks in probe()

2025-04-30 Thread Dan Carpenter
t for Sitronix ST7571 LCD controller") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/tiny/st7571-i2c.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/tiny/st7571-i2c.c b/drivers/gpu/drm/tiny/st7571-i2c.c index dc410ec41baf..eec846892962 10

[PATCH] drm/bridge: cdns-mhdp8546: unlock on error in cdns_mhdp_atomic_enable()

2025-04-30 Thread Dan Carpenter
rm: bridge: cdns-mhdp8546: Fix possible null pointer dereference") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers

[PATCH next] drm/amdgpu/userq: Call unreserve on error in amdgpu_userq_fence_read_wptr()

2025-04-30 Thread Dan Carpenter
This error path should call amdgpu_bo_unreserve() before returning. Fixes: d8675102ba32 ("drm/amdgpu: add vm root BO lock before accessing the vm") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 1 + 1 file changed, 1 insertion(+) diff --git a/d

[bug report] drm: panel: Add driver for Himax HX8279 DDIC panels

2025-04-22 Thread Dan Carpenter
si_generic_write_multi(dsi_ctx, cmd_set_dig_gamma, 615 ARRAY_SIZE(cmd_set_dig_gamma)); 616 } 617 } 618 } regards, dan carpenter

[PATCH next] drm/udl: Set error code in udl_init()

2025-04-16 Thread Dan Carpenter
Return -ENOMEM if udl_alloc_urb_list() fails. Don't return success. Fixes: fb10144ba426 ("drm/udl: Support adapters without firmware descriptor") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/udl/udl_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/u

Re: [bug report] drm/panthor: Call panthor_gpu_coherency_init() after PM resume()

2025-04-15 Thread Dan Carpenter
definitely be > > goto err_unplug_gpu; > > Do you plan to send a patch, or should I do it? > I'm on vacation. regards, dan carpenter

[PATCH next] drm/amdkfd: Fix kfd_smi_event_process()

2025-04-15 Thread Dan Carpenter
The "pdd->drm_priv" NULL check is reversed so it will lead to a NULL dereference on the next line. Fixes: 4172b556fd5b ("drm/amdkfd: add smi events for process start and end") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 2 +- 1 file cha

[PATCH v2 1/2] drm/amdgpu: Fix double free in amdgpu_userq_fence_driver_alloc()

2025-04-12 Thread Dan Carpenter
it to -ENOMEM. Fixes: e7cf21fbb277 ("drm/amdgpu: Few optimization and fixes for userq fence driver") Signed-off-by: Dan Carpenter --- v2: No change. drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dri

[PATCH v2 2/2] drm/amdgpu: Clean up error handling in amdgpu_userq_fence_driver_alloc()

2025-04-12 Thread Dan Carpenter
The "fence_drv" is already NULL so no cleanup is necessary. Signed-off-by: Dan Carpenter --- v2: New patch drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/driv

[bug report] drm/panthor: Call panthor_gpu_coherency_init() after PM resume()

2025-04-12 Thread Dan Carpenter
v); 275 panthor_sched_unplug(ptdev); 276 277 err_unplug_fw: 278 panthor_fw_unplug(ptdev); 279 280 err_unplug_mmu: 281 panthor_mmu_unplug(ptdev); 282 283 err_unplug_gpu: 284 panthor_gpu_unplug(ptdev); 285 286 err_rpm_put: 287 pm_runtime_put_sync_suspend(ptdev->base.dev); 288 return ret; 289 } regards, dan carpenter

[PATCH v2 0/2] drm/amdgpu: Fixes to amdgpu_userq_fence_driver_alloc()

2025-04-12 Thread Dan Carpenter
This fixes a double free on one error path in amdgpu_userq_fence_driver_alloc() and cleans up another error path. v2: Did some additional cleanup Dan Carpenter (2): drm/amdgpu: Fix double free in amdgpu_userq_fence_driver_alloc() drm/amdgpu: Clean up error handling in

Re: [PATCH next] drm/amdgpu: Fix double free in amdgpu_userq_fence_driver_alloc()

2025-04-12 Thread Dan Carpenter
makes the patch confusing to add this unrelated cleanup... I'll send it as a separate patch. regards, dan carpenter

[PATCH next] drm/amdgpu: Fix double free in amdgpu_userq_fence_driver_alloc()

2025-04-10 Thread Dan Carpenter
it to -ENOMEM. Fixes: e7cf21fbb277 ("drm/amdgpu: Few optimization and fixes for userq fence driver") Signed-off-by: Dan Carpenter --- --- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/

[PATCH next] drm/syncobj: Fix leak in drm_syncobj_import_sync_file_fence()

2025-04-10 Thread Dan Carpenter
We need to cleanup if the chain = dma_fence_chain_alloc() allocation fails. Now that we have multiple error returns in this function, switch to using an unwind ladder for cleanup. Fixes: c2d3a7300695 ("drm/syncobj: Extend EXPORT_SYNC_FILE for timeline syncobjs") Signed-off-by: Dan

[PATCH] drm/display: dp: delete some dead code

2025-04-10 Thread Dan Carpenter
We re-worked this code a bit in commit af67978ee37e ("drm/display: dp: use new DCPD access helpers") but there was a little bit of stray dead code left over. Clean it up. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/display/drm_dp_helper.c | 9 ++--- 1 file changed, 2 insert

[bug report] HACK: drm/panel: ltk050h3146w: read panel-id

2025-04-09 Thread Dan Carpenter
;< 16) | (id[1] << 8) | (id[2] << 0); 492 } 493 494 static int ltk050h3146w_prepare(struct drm_panel *panel) 495 { regards, dan carpenter

[PATCH v2] dma-buf/sw_sync: Decrement refcount on error in sw_sync_ioctl_get_deadline()

2025-04-08 Thread Dan Carpenter
Call dma_fence_put(fence) before returning an error if dma_fence_to_sync_pt() fails. Use an unwind ladder at the end of the function to do the cleanup. Fixes: 70e67aaec2f4 ("dma-buf/sw_sync: Add fence deadline support") Signed-off-by: Dan Carpenter --- v2: style changes. drive

Re: [PATCH] drm/vc4: fix uninitialized smatch warnings

2025-04-07 Thread Dan Carpenter
t; > uninitialized symbol 'ret'. > > > > Reported-by: kernel test robot > > Reported-by: Dan Carpenter > > Closes: https://lore.kernel.org/r/202504021500.3am1hkks-...@intel.com/ > > Signed-off-by: sunliming > > --- > > drivers/gpu/drm/vc4/vc4_

[PATCH] drm/bridge: chrontel-ch7033: Fix precedence bug in ch7033_bridge_mode_set()

2025-04-05 Thread Dan Carpenter
ch7033: Add a new driver") Signed-off-by: Dan Carpenter --- >From static analysis. Not tested! drivers/gpu/drm/bridge/chrontel-ch7033.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/chrontel-ch7033.c b/drivers/gpu/drm/bridge/chro

[PATCH v2] drm/vc4: release firmware on error paths in vc4_hvs_bind()

2025-04-05 Thread Dan Carpenter
There was a bug where we should have called rpi_firmware_put(firmware) if devm_clk_get() failed. Really, it's better and more readable to move all the firmware code together so that we can release it one time. Fixes: 2fa4ef5fb943 ("drm/vc4: hvs: Create hw_init function") Sig

Re: [PATCH] dma-buf/sw_sync: Decrement refcount on error in sw_sync_ioctl_get_deadline()

2025-04-04 Thread Dan Carpenter
On Mon, Mar 31, 2025 at 02:02:44PM +0200, Christian König wrote: > Am 31.03.25 um 11:45 schrieb Dan Carpenter: > > Call dma_fence_put(fence) before returning an error on this error path. > > > > Fixes: 70e67aaec2f4 ("dma-buf/sw_sync: Add fence deadline support") &

Re: [PATCH] drm/vc4: release firmware on error paths in vc4_hvs_bind()

2025-04-03 Thread Dan Carpenter
On Wed, Apr 02, 2025 at 11:34:58AM +, Dave Stevenson wrote: > Hi Dan > > On Wed, 2 Apr 2025 at 12:00, Dan Carpenter wrote: > > > > Call rpi_firmware_put() on these two error paths before returning. > > Ack that there is an issue here, but it seems eas

[PATCH] drm/vc4: release firmware on error paths in vc4_hvs_bind()

2025-04-02 Thread Dan Carpenter
Call rpi_firmware_put() on these two error paths before returning. Fixes: 2fa4ef5fb943 ("drm/vc4: hvs: Create hw_init function") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/vc4/vc4_hvs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drive

[PATCH] dma-buf/sw_sync: Decrement refcount on error in sw_sync_ioctl_get_deadline()

2025-03-31 Thread Dan Carpenter
Call dma_fence_put(fence) before returning an error on this error path. Fixes: 70e67aaec2f4 ("dma-buf/sw_sync: Add fence deadline support") Signed-off-by: Dan Carpenter --- drivers/dma-buf/sw_sync.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/dma-buf

Re: [PATCH] kunit: fixes backtrace suppression test module description

2025-03-31 Thread Dan Carpenter
;kunit: add test cases for backtrace warning > suppression") > Yeah. Everyone should configure the default hash length to 12. git config set --global core.abbrev 12 I generate my fixes tags like so: #!/bin/bash git log -1 --format='Fixes: %h ("%s")' $* regards, dan carpenter

Re: [PATCH v4 07/14] arm64: Add support for suppressing warning backtraces

2025-03-19 Thread Dan Carpenter
;t been following the conversation closely (plus I'm pretty stupid as well) so I'm not sure if it will trigger here... regards, dan carpenter

Re: [PATCH v6 6/6] drm/xe/xe_vm: Implement xe_vm_get_faults_ioctl

2025-03-15 Thread Dan Carpenter
| Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202503091053.hg9hub8c-...@intel.com/ New smatch warnings: drivers/gpu/drm/xe/xe_vm.c:3557 fill_faults() warn: iterator 'i' not incremented vim +/i +3557 drivers/gpu/drm/xe/xe_vm.c 24e54

[PATCH] drm/i915/gsc: delete a stray tab in intel_gsc_fw_get_binary_info()

2025-03-15 Thread Dan Carpenter
This line is indented on tab too far. Delete the extra tab. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c

Re: [PATCH next] drm/xe: Fix uninitialized variable in xe_vm_bind_ioctl()

2025-03-12 Thread Dan Carpenter
On Mon, Mar 10, 2025 at 12:56:46PM -0400, Rodrigo Vivi wrote: > On Mon, Mar 10, 2025 at 01:48:00PM +0300, Dan Carpenter wrote: > > The error handling assumes that vm_bind_ioctl_check_args() will > > initialize "bind_ops" but there are a couple early returns where that&#x

[PATCH next] drm/xe: Fix uninitialized variable in xe_vm_bind_ioctl()

2025-03-10 Thread Dan Carpenter
The error handling assumes that vm_bind_ioctl_check_args() will initialize "bind_ops" but there are a couple early returns where that's not true. Initialize "bind_ops" to NULL from the start. Fixes: b43e864af0d4 ("drm/xe/uapi: Add DRM_XE_VM_BIND_FLAG_CPU_AD

[PATCH] drm/amdkfd: delete stray tab in kfd_dbg_set_mes_debug_mode()

2025-03-10 Thread Dan Carpenter
These lines are indented one tab more than they should be. Delete the stray tabs. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c b/drivers/gpu/drm

[PATCH] drm/amdgpu: Use tabs for indenting in amdgpu_sdma_reset_engine()

2025-03-10 Thread Dan Carpenter
This line has a seven space indent instead of a tab. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c index

[PATCH] drm/amdgpu/gfx: delete stray tabs

2025-03-10 Thread Dan Carpenter
These lines are indented one tab too far. Delete the extra tabs. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

[PATCH v2] accel/qaic: Fix integer overflow in qaic_validate_req()

2025-03-08 Thread Dan Carpenter
These are u64 variables that come from the user via qaic_attach_slice_bo_ioctl(). Use check_add_overflow() to ensure that the math doesn't have an integer wrapping bug. Cc: sta...@vger.kernel.org Fixes: ff13be830333 ("accel/qaic: Add datapath") Signed-off-by: Dan Carpent

[bug report] drm/gpusvm: Add support for GPU Shared Virtual Memory

2025-03-08 Thread Dan Carpenter
range->notifier_seq = LONG_MAX; 800 range->flags.migrate_devmem = migrate_devmem ? 1 : 0; 801 802 return range; 803 } regards, dan carpenter

Re: [PATCH] accel/qaic: Fix integer overflow in qaic_validate_req()

2025-03-07 Thread Dan Carpenter
On Thu, Mar 06, 2025 at 12:12:53PM -0700, Jeff Hugo wrote: > On 3/5/2025 8:53 AM, Dan Carpenter wrote: > > These are u64 variables that come from the user via > > qaic_attach_slice_bo_ioctl(). Ensure that the math doesn't have an > > integer wrapping bug. > >

[PATCH next] drm/msm/dpu: Fix uninitialized variable in dpu_crtc_kickoff_clone_mode()

2025-03-07 Thread Dan Carpenter
After the loop there is a check for whether "wb_encoder" has been set to non-NULL, however it was never set to NULL. Initialize it to NULL. Fixes: ad06972d5365 ("drm/msm/dpu: Reorder encoder kickoff for CWB") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/disp/dpu1/

[PATCH next] drm: adp: Fix NULL vs IS_ERR() check in adp_plane_new()

2025-03-07 Thread Dan Carpenter
The __drmm_universal_plane_alloc() function doesn't return NULL, it returns error pointers. Update the check to match. Fixes: 332122eba628 ("drm: adp: Add Apple Display Pipe driver") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/adp/adp_drv.c | 4 ++-- 1 file changed, 2 i

[PATCH] accel/qaic: Fix integer overflow in qaic_validate_req()

2025-03-05 Thread Dan Carpenter
These are u64 variables that come from the user via qaic_attach_slice_bo_ioctl(). Ensure that the math doesn't have an integer wrapping bug. Cc: sta...@vger.kernel.org Fixes: ff13be830333 ("accel/qaic: Add datapath") Signed-off-by: Dan Carpenter --- drivers/accel/qaic/qaic_da

Re: [RFC] Clarification for “undefined behaviour”?

2025-03-05 Thread Dan Carpenter
On Wed, Mar 05, 2025 at 02:17:32PM +, David Laight wrote: > On Wed, 5 Mar 2025 11:51:59 +0300 > Dan Carpenter wrote: > > > On Wed, Mar 05, 2025 at 09:40:43AM +0100, Markus Elfring wrote: > > > >>> The address of a data structure member was determined befo

Re: [bug report] habanalabs/gaudi: fix a race condition causing DMAR error

2025-03-05 Thread Dan Carpenter
Yuri's email is bouncing. Another related warnings: drivers/accel/habanalabs/gaudi/gaudi.c:5344 gaudi_parse_cb_mmu() warn: potential user controlled sizeof overflow 'parser->user_cb_size + gaudi_get_patched_cb_extra_size(parser->user_cb_size)' '0-u32max + 0-u32max&#x

[bug report] habanalabs/gaudi: fix a race condition causing DMAR error

2025-03-05 Thread Dan Carpenter
b_size is a user controlled variable that comes from cs_ioctl_default(). This addition operation could result in an interger wrapping bug. 1423 return cacheline_end - user_cb_size + additional_commands; 1424 else 1425 return additional_commands; 1426 } regards, dan carpenter

Re: [RFC] Clarification for “undefined behaviour”?

2025-03-05 Thread Dan Carpenter
behavior here. > > Is there a need to improve the wording precision? > > There are words which denote a special meaning according to aspects of > the programming language “C”. > https://en.cppreference.com/w/c/language/behavior > > Dereferences of null pointers are treated in special ways. This not a dereference. It's just pointer math. regards, dan carpenter

Re: [PATCH RESEND] drm/nouveau: Add a jump label in nouveau_gem_ioctl_pushbuf()

2025-03-03 Thread Dan Carpenter
'm not entirely sure, but I remember that we had this discussion already. > > Can you please send patches from the same address as indicated by your SoB? This is not a bug fix so it shouldn't have a Fixes tag. regards, dan carpenter

Re: [PATCH RESEND] video: au1100fb: Move a variable assignment behind a null pointer check in au1100fb_setmode()

2025-03-03 Thread Dan Carpenter
On Mon, Mar 03, 2025 at 11:30:46AM +0100, Uwe Kleine-König wrote: > On Mon, Mar 03, 2025 at 01:08:29PM +0300, Dan Carpenter wrote: > > On Mon, Mar 03, 2025 at 10:19:06AM +0100, Uwe Kleine-König wrote: > > > Hello, > > > > > > On Sun, Mar 02, 2025 at 07

Re: [PATCH RESEND] video: au1100fb: Move a variable assignment behind a null pointer check in au1100fb_setmode()

2025-03-03 Thread Dan Carpenter
On Mon, Mar 03, 2025 at 01:08:29PM +0300, Dan Carpenter wrote: > Real bugs where we dereference a pointer and then check for NULL don't > last long in the kernel. Most of the stuff Markus is sending is false > positives like this. Maybe I was too optimistic. Here are the Smatch

Re: [PATCH RESEND] video: au1100fb: Move a variable assignment behind a null pointer check in au1100fb_setmode()

2025-03-03 Thread Dan Carpenter
org > > to ensure this is backported to stable. It's not a bugfix, it's a cleanup. That's not a dereference, it's just pointer math. It shouldn't have a Fixes tag. Real bugs where we dereference a pointer and then check for NULL don't last long in the kernel. Most of the stuff Markus is sending is false positives like this. regards, dan carpenter

Re: [RESEND] drm/msm/dpu: Delete a variable initialisation before a null pointer check in two functions

2025-03-03 Thread Dan Carpenter
's just pointer math. It was a common way to implement offsetof() before we had a builtin for that. samples/bpf/test_lru_dist.c # define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER) regards, dan carpenter

Re: [PATCH RESEND] drm/msm/dpu: Delete a variable initialisation before a null pointer check in two functions

2025-03-02 Thread Dan Carpenter
hsets. Otherwise they have a pretty high chance to be > ignored by the maintainers. Use a fresh git-send-email command to send > new patchset. > > > > > Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Remove the Fixes tag. This patch is fine as a clean up. > > Signed-off-by: Markus Elfring regards, dan carpenter

[PATCH next] drm/vc4: hdmi: Fix some NULL vs IS_ERR() bugs

2025-02-28 Thread Dan Carpenter
The devm_platform_ioremap_resource_byname() function doesn't return NULL, it returns error pointers. Update the checking to match. Fixes: b93f07cf090a ("drm/vc4: move to devm_platform_ioremap_resource() usage") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/vc4/

Re: [PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()

2025-02-25 Thread Dan Carpenter
On Tue, Feb 25, 2025 at 11:10:29AM +0200, Jani Nikula wrote: > On Mon, 24 Feb 2025, Dan Carpenter wrote: > > On Mon, Feb 24, 2025 at 03:14:33PM +0200, Jani Nikula wrote: > >> On Wed, 19 Feb 2025, Dan Carpenter wrote: > >> > The "id" variable is an enu

[PATCH next] drm/msm/dpu: fix error pointer dereference in msm_kms_init_aspace()

2025-02-24 Thread Dan Carpenter
If msm_gem_address_space_create() fails, then return right away. Otherwise it leads to a Oops when we dereference "aspace" on the next line. Fixes: 2d215d440faa ("drm/msm: register a fault handler for display mmu faults") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/ms

Re: [PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()

2025-02-24 Thread Dan Carpenter
On Mon, Feb 24, 2025 at 03:14:33PM +0200, Jani Nikula wrote: > On Wed, 19 Feb 2025, Dan Carpenter wrote: > > The "id" variable is an enum and in this context it's treated as an > > unsigned int so the error handling can never trigger. The > > ->get_client

Re: [PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()

2025-02-19 Thread Dan Carpenter
On Wed, Feb 19, 2025 at 05:17:56PM +0200, Jani Nikula wrote: > On Wed, 19 Feb 2025, Dan Carpenter wrote: > > The "id" variable is an enum and in this context it's treated as an > > unsigned int so the error handling can never trigger. > > When would that be

[PATCH] vgaswitcheroo: Fix error checking in vga_switcheroo_register_audio_client()

2025-02-19 Thread Dan Carpenter
D on error. Let's check for both negatives and UNKNOWN_ID so we'll catch it either way. Reported-by: Su Hui Closes: https://lore.kernel.org/all/20231026021056.850680-1-su...@nfschina.com/ Fixes: 4aaf448fa975 ("vga_switcheroo: set audio client id according to bound GPU

[PATCH] drm/msm/gem: Fix error code msm_parse_deps()

2025-02-16 Thread Dan Carpenter
45bf ("drm/msm: UAPI error reporting") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/msm_gem_submit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index dee470403036..3e9aa2cc38ef 10

[PATCH next] drm/nouveau: Fix error pointer dereference in r535_gsp_msgq_recv()

2025-02-16 Thread Dan Carpenter
If "rpc" is an error pointer then return directly. Otherwise it leads to an error pointer dereference. Fixes: 50f290053d79 ("drm/nouveau: support handling the return of large GSP message") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 1

Re: [bug report] drm/panthor: Expose size of driver internal BO's over fdinfo

2025-02-16 Thread Dan Carpenter
Similar issue in panthor_fdinfo_gather_group_samples() drivers/gpu/drm/panthor/panthor_sched.c:2883 panthor_fdinfo_gather_group_samples() warn: sleeping in atomic context regards, dan carpenter

[bug report] drm/panthor: Expose size of driver internal BO's over fdinfo

2025-02-16 Thread Dan Carpenter
;vm->heaps.lock); 1972 1973 stats->resident += size; 1974 if (vm->as.id >= 0) 1975 stats->active += size; 1976 } 1977 xa_unlock(&pfile->vms->xa); 1978 } regards, dan carpenter

[PATCH next] drm/tests: Fix a test in drm_test_check_valid_clones()

2025-02-12 Thread Dan Carpenter
The drm_atomic_get_crtc_state() function returns error pointers and not NULL. Update the check to check for error pointers as well as NULL. Fixes: 88849f24e2ab ("drm/tests: Add test for drm_atomic_helper_check_modeset()") Signed-off-by: Dan Carpenter --- drivers/gpu

[PATCH next] drm: writeback: Fix use after free in drm_writeback_connector_cleanup()

2025-02-12 Thread Dan Carpenter
The drm_writeback_cleanup_job() function frees "pos" so call list_del(&pos->list_entry) first to avoid a use after free. Fixes: 1914ba2b91ea ("drm: writeback: Create drmm variants for drm_writeback_connector initialization") Signed-off-by: Dan Carpenter --- drivers/

Re: [PATCH] drm/amd/display: restore edid reading from a given i2c adapter

2025-02-12 Thread Dan Carpenter
), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202502121000.ebcedoo9-...@intel.com/ New smatch warnings: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7201 amdgpu_dm_connector_funcs_force() warn: variable

Re: [PATCH next] drm/i915: Fix NULL vs IS_ERR() check in __shmem_writeback()

2025-02-07 Thread Dan Carpenter
On Fri, Feb 07, 2025 at 12:02:43PM +0100, Andi Shyti wrote: > Hi Dan, > > On Thu, Feb 06, 2025 at 11:17:02AM +0300, Dan Carpenter wrote: > > The filemap_lock_folio() function doesn't return NULL, it returns error > > pointers. > > > > Fixes: 25dd342f0cc8 (&q

[PATCH next] drm/i915: Fix NULL vs IS_ERR() check in __shmem_writeback()

2025-02-06 Thread Dan Carpenter
The filemap_lock_folio() function doesn't return NULL, it returns error pointers. Fixes: 25dd342f0cc8 ("drm/i915/gem: convert __shmem_writeback() to folios") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 de

Re: [PATCH v3] drm/bridge: display-connector: implement the error path of .probe()

2025-01-30 Thread Dan Carpenter
t; } > > static void display_connector_remove(struct platform_device *pdev) > @@ -397,8 +405,7 @@ static void display_connector_remove(struct > platform_device *pdev) > > drm_bridge_remove(&conn->bridge); > > - if (!IS_ERR(conn->bridge.ddc)) > - i2c_put_adapter(conn->bridge.ddc); > + i2c_put_adapter(conn->bridge.ddc); This change is a nice cleanup and perhaps it silences a warning in your static checker? It should be mentioned in the commit message. regards, dan carpenter

Re: [PATCH] drm/panthor: avoid garbage value in panthor_ioctl_dev_query()

2025-01-19 Thread Dan Carpenter
gt; > Fixes: f7ef2352 ("drm/panthor: Add DEV_QUERY_GROUP_PRIORITIES_INFO dev > query") > Signed-off-by: Su Hui Reviewed-by: Dan Carpenter How did you find this bug? regards, dan carpenter

Re: [bug report] accel/amdxdna: Enhance power management settings

2025-01-08 Thread Dan Carpenter
On Wed, Jan 08, 2025 at 10:14:47AM -0800, Lizhi Hou wrote: > > On 1/8/25 00:40, Dan Carpenter wrote: > > Hello Lizhi Hou, > > > > Commit f4d7b8a6bc8c ("accel/amdxdna: Enhance power management > > settings") from Dec 13, 2024 (linux-next), leads to the fol

[PATCH RESEND] drm/mediatek: dsi: fix error codes in mtk_dsi_host_transfer()

2025-01-08 Thread Dan Carpenter
0801.iadw0oih-...@intel.com/ Signed-off-by: Dan Carpenter Reviewed-by: Mattijs Korpershoek Reviewed-by: AngeloGioacchino Del Regno --- I sent this patch earlier: https://lore.kernel.org/all/Y%2FyBC4yxTs+Po0TG@kili/ but it wasn't applied. I've changed the commit message a bit and added new

[PATCH] drm/amdgpu: Fix shift type in amdgpu_debugfs_sdma_sched_mask_set()

2025-01-08 Thread Dan Carpenter
_SDMA_INSTANCES (16) bits. So this bug does not affect anything in real life. Still, for correctness sake, u64 bit masks should use BIT_ULL(). Fixes: d2e3961ae371 ("drm/amdgpu: add amdgpu_sdma_sched_mask debugfs") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu

[bug report] drm/bridge: it6505: fix HDCP CTS compare V matching

2025-01-08 Thread Dan Carpenter
_DEBUG_DRIVER(dev, "V' all match!! %d, %d", retry, i); 2259 return true; But it is a "loop" from 0-0. 2260 } 2261 } 2262 2263 DRM_DEV_DEBUG_DRIVER(dev, "V' NOT match!! %d", retry); 2264 return false; 2265 } regards, dan carpenter

[bug report] accel/amdxdna: Enhance power management settings

2025-01-08 Thread Dan Carpenter
%d\n", 80 ndev->npuclk_freq, ndev->hclk_freq); 81 82 return 0; 83 } regards, dan carpenter

Re: [PATCH v2] drm/bridge: display-connector: implement the error path of .probe()

2025-01-06 Thread Dan Carpenter
robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202412212129.ot9bt8p0-...@intel.com/ smatch warnings: drivers/gpu/drm/bridge/display-connector.c:397 display_connector_probe() error: uninitialized symbol 'ret'. vim +/ret +397 drivers/gpu/drm/bridge/display-c

[PATCH v2 next] drm/vc4: unlock on error in vc4_hvs_get_fifo_frame_count()

2024-12-12 Thread Dan Carpenter
The default statement is never used in real life. However, if it were used for some reason then call drm_dev_exit() before returning. Fixes: 8f2fc64773be ("drm/vc4: Fix reading of frame count on GEN5 / Pi4") Signed-off-by: Dan Carpenter --- v2: style fixes drivers/gpu/drm/vc4/vc4

Re: [PATCH next] drm/vc4: unlock on error in vc4_hvs_get_fifo_frame_count()

2024-12-12 Thread Dan Carpenter
our* opinion, Dave. Everyone else can bounce. I'll send a v2 which adds the break. regards, dan carpenter

[PATCH next] drm/vc4: unlock on error in vc4_hvs_get_fifo_frame_count()

2024-12-12 Thread Dan Carpenter
Presumably the default path is never used. However, if it were used for some reason then call drm_dev_exit() before returning. Fixes: 8f2fc64773be ("drm/vc4: Fix reading of frame count on GEN5 / Pi4") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/vc4/vc4_hvs.c | 2 +- 1 file

Re: [PATCH v9 2/6] drm/log: Introduce a new boot logger to draw the kmsg on the screen

2024-12-12 Thread Dan Carpenter
On Thu, Dec 12, 2024 at 09:49:19AM +0100, Jocelyn Falempe wrote: > On 12/12/2024 08:41, Dan Carpenter wrote: > > This patch breaks "make oldconfig" for me. It just gets into an endless > > loop of: > > > >Default DRM Client > >choice[1-0?]: 0

Re: [PATCH v9 2/6] drm/log: Introduce a new boot logger to draw the kmsg on the screen

2024-12-11 Thread Dan Carpenter
it starts scrolling endlessly. https://download.01.org/0day-ci/archive/20241212/202412121555.fp663tyh-...@intel.com/config regards, dan carpenter

Re: [PATCH 1/1] Remove hard-coded strings by using the helper functions str_true_false()

2024-11-20 Thread Dan Carpenter
-to-send-a-v2-patch/ regards, dan carpenter

Re: [PATCH v2 05/21] powerpc/papr_scm: Convert timeouts to secs_to_jiffies()

2024-11-16 Thread Dan Carpenter
ne of these introduced a line break that wasn't there before so I think maybe Coccinelle is applying the 80 character line break rule? There are sometimes where the 80 character rule really hurts readability, but here it doesn't make any difference. regards, dan carpenter

Re: [PATCH 19/22] livepatch: Convert timeouts to secs_to_jiffies()

2024-11-15 Thread Dan Carpenter
work, > - msecs_to_jiffies(1000 * 0)); > + secs_to_jiffies(0)); Better to just call schedule_delayed_work(&work, 0); > return 0; > } regards, dan carpenter

[PATCH] drm/msm/gem: prevent integer overflow in msm_ioctl_gem_submit()

2024-11-15 Thread Dan Carpenter
cmdstream size check") Cc: sta...@vger.kernel.org Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/msm_gem_submit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index fba78193127d..f7756

Re: [PATCH][next] drm/amd/amdgpu: Fix spelling mistake "versoin" -> "version"

2024-11-13 Thread Dan Carpenter
x63 to support limit single process feature.\n"); > + dev_err(mes->adev->dev, "MES FW version must be larger > than 0x63 to support limit single process feature.\n"); What does "to support limit single process feature" mean? regards, dan carpenter

[PATCH next] drm/bridge: ite-it6263: Prevent error pointer dereference in probe()

2024-11-12 Thread Dan Carpenter
If devm_i2c_new_dummy_device() fails then we were supposed to return an error code, but instead the function continues and will crash on the next line. Add the missing return statement. Fixes: 049723628716 ("drm/bridge: Add ITE IT6263 LVDS to HDMI converter") Signed-off-by: Dan

[bug report] drm/mediatek: Implement OF graphs support for display paths

2024-11-12 Thread Dan Carpenter
dev_err(dev, "Cannot find first endpoint for path %d\n", cpath); 921 922 return ret; 923 } 924 } 925 idx++; 926 regards, dan carpenter

[PATCH next] drm: zynqmp_dp: Unlock on error in zynqmp_dp_bridge_atomic_enable()

2024-11-11 Thread Dan Carpenter
We added some locking to this function, but accidentally forgot to unlock if zynqmp_dp_mode_configure() failed. Use a guard lock to fix it. Fixes: a7d5eeaa57d7 ("drm: zynqmp_dp: Add locking") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/xlnx/zynqmp_dp.c | 3 +-- 1 file changed, 1

Re: [PATCH v3 1/2] drm/display/dsc: Refactor DRM MST DSC Determination Policy

2024-11-07 Thread Dan Carpenter
: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202411071102.0cmtieio-...@intel.com/ smatch warnings: drivers/gpu/drm/display/drm_dp_mst_topology.c:6043 drm_dp_mst_dsc_aux_for_port() warn: variable dereferenced before check 'port' (see line 6033)

Re: [PATCH 2/2] drm: bridge: ti-sn65dsi83: Add error recovery mechanism

2024-10-28 Thread Dan Carpenter
-ci/archive/20241026/202410262052.crr7xezu-...@intel.com/config) compiler: csky-linux-gcc (GCC) 14.1.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

Re: [PATCH 3/3] drm/panel: add Fitipower EK79007AD3 panel driver

2024-10-25 Thread Dan Carpenter
(GCC) 14.1.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/202410252201.qglvauic-...@intel.com/ smatch warnings

Re: [PATCH next] drm/sharp-memory: Fix some checks in sharp_memory_probe()

2024-10-25 Thread Dan Carpenter
On Thu, Oct 24, 2024 at 11:08:05PM +0200, Uwe Kleine-König wrote: > On Wed, Oct 23, 2024 at 11:30:31AM +0300, Dan Carpenter wrote: > > The devm_drm_dev_alloc() function returns error pointers, it never > > returns NULL. Change that check to IS_ERR(). > > > >

[PATCH next] drm/amdgpu: Fix amdgpu_ip_block_hw_fini()

2024-10-24 Thread Dan Carpenter
This NULL check is reversed so the function doesn't work. Fixes: dad01f93f432 ("drm/amdgpu: validate hw_fini before function call") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driv

[PATCH next] drm/fsl-dcu: prevent error pointer dereference in fsl_dcu_load()

2024-10-23 Thread Dan Carpenter
ction. Fixes: ffcde9e44d3e ("drm: fsl-dcu: enable PIXCLK on LS1021A") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fs

[PATCH next] drm/sharp-memory: Fix some checks in sharp_memory_probe()

2024-10-23 Thread Dan Carpenter
("drm/tiny: Add driver for Sharp Memory LCD") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/tiny/sharp-memory.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tiny/sharp-memory.c b/drivers/gpu/drm/tiny/sharp-memory.c index 2d2315bd6aef..1b

[PATCH next] drm/amdgpu: Fix a double lock bug

2024-10-17 Thread Dan Carpenter
This was supposed to be an unlock instead of a lock. The original code will lead to a deadlock. Fixes: ee52489d1210 ("drm/amdgpu: Place NPS mode request on unload") Signed-off-by: Dan Carpenter --- >From static analysis, not testing. --- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c |

[PATCH] fbdev/da8xx-fb: unlock on error paths in suspend/resume

2024-10-11 Thread Dan Carpenter
Add a missing console_unlock() in the suspend and resume functions on the error paths. Fixes: 611097d5daea ("fbdev: da8xx: add support for a regulator") Signed-off-by: Dan Carpenter --- drivers/video/fbdev/da8xx-fb.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) di

Re: [bug report] drm: add DRM_SET_CLIENT_NAME ioctl

2024-10-11 Thread Dan Carpenter
On Fri, Oct 11, 2024 at 10:20:03AM +0200, Pierre-Eric Pelloux-Prayer wrote: > > Hi, > > Le 10/10/2024 à 12:02, Dan Carpenter a écrit : > > Hello Pierre-Eric Pelloux-Prayer, > > > > Commit 56c594d8df64 ("drm: add DRM_SET_CLIENT_NAME ioctl") from Oc

[PATCH next] drm/amdgpu: Fix off by one in current_memory_partition_show()

2024-10-10 Thread Dan Carpenter
The >= ARRAY_SIZE() should be > ARRAY_SIZE() to prevent an out of bounds read. Fixes: 012be6f22c01 ("drm/amdgpu: Add sysfs interfaces for NPS mode") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(

[bug report] drm: add DRM_SET_CLIENT_NAME ioctl

2024-10-10 Thread Dan Carpenter
(m), uid), 111priv->magic, 112DRM_CLIENT_NAME_MAX_LEN, 113priv->client_name ? priv->client_name : ""); 114 rcu_read_unlock(); 115 mutex_unlock(&priv->client_name_lock); 116 } 117 mutex_unlock(&dev->filelist_mutex); 118 return 0; 119 } regards, dan carpenter

  1   2   3   4   5   6   7   8   9   10   >