Re: [PATCH 1/6] auxdisplay/ht16k33: Replace use of fb_blank with backlight helper

2024-03-13 Thread Dan Carpenter
advantage to making this const? regards, dan carpenter

Re: [PATCH 00/14] Add support for suppressing warning backtraces

2024-03-13 Thread Dan Carpenter
Thanks! Acked-by: Dan Carpenter regards, dan carpenter

[drm-intel:for-linux-next-gt 1/4] drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:2680 guc_context_policy_init_v70() warn: variable dereferenced before check 'ce' (see line 2663)

2024-03-10 Thread Dan Carpenter
/20240310/202403101225.7ahejhzj-...@intel.com/config) compiler: gcc-12 (Debian 12.2.0-14) 12.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

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] 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 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 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 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

[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

[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/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 '

[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/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 ++

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/i915/gvt: Fix uninitialized variable in handle_mmio()

2024-01-26 Thread Dan Carpenter
. Fixes: e0f74ed4634d ("i915/gvt: Separate the MMIO tracking table from GVT-g") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gvt/handlers.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handler

[bug report] drm/amdkfd: Export DMABufs from KFD using GEM handles

2024-01-23 Thread Dan Carpenter
close_fd(fd); 825 if (WARN_ON_ONCE(IS_ERR(dmabuf))) 826 return PTR_ERR(dmabuf); 827 mem->dmabuf = dmabuf; 828 } 829 830 return 0; 831 } regards, dan carpenter

Re: [PATCH][next] drm/nouveau/fifo/gk104: remove redundant variable ret

2024-01-23 Thread Dan Carpenter
Let's CC Felix on this one because he might know the answer. All day long I spend looking at code like this: net/core/dev.c:724 dev_fill_forward_path() info: returning a literal zero is cleaner net/core/dev.c:732 dev_fill_forward_path() info: returning a literal zero is cleaner net/core/dev.c

Re: [PATCH][next] drm/nouveau/fifo/gk104: remove redundant variable ret

2024-01-22 Thread Dan Carpenter
On Tue, Jan 23, 2024 at 12:04:23AM +0100, Danilo Krummrich wrote: > On 1/16/24 13:31, Dan Carpenter wrote: > > On Tue, Jan 16, 2024 at 11:16:09AM +, Colin Ian King wrote: > > > The variable ret is being assigned a value but it isn't being > > > read afterwards.

Re: [PATCH][next] drm/nouveau/fifo/gk104: remove redundant variable ret

2024-01-16 Thread Dan Carpenter
st(struct nvif_device *device, u64 engine) > { > u64 runm = 0; > - int ret, i; > + int i; > > - if ((ret = nvif_fifo_runlists(device))) > + if (nvif_fifo_runlists(device)) > return runm; Could we return a literal zero here? Otherwise, I'm surprised this doesn't trigger a static checker warning. regards, dan carpenter

[PATCH] drm/nouveau/disp/r535: fix error code in r535_dp_aux_xfer()

2024-01-12 Thread Dan Carpenter
This code was shuffled around but the return wasn't updated. It should return "ret" instead of "ctrl". Fixes: 4ae3a20102b2 ("nouveau/gsp: don't free ctrl messages on errors") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/nouveau/nvkm/engine/disp/r5

[PATCH] drm/amdgpu: fix return value in aca_bank_hwip_is_matched()

2024-01-12 Thread Dan Carpenter
The aca_bank_hwip_is_matched() function is type bool. This error path return -EINVAL which is cast to true, but it should return false instead. Fixes: 22a4fa4709e3 ("drm/amdgpu: implement RAS ACA driver framework") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu

[bug report] backlight: hx8357: Convert to agnostic GPIO API

2024-01-10 Thread Dan Carpenter
628 ret = ((int (*)(struct lcd_device *))match->data)(lcdev); 629 if (ret) { 630 dev_err(&spi->dev, "Couldn't initialize panel\n"); 631 return ret; 632 } 633 634 dev_info(&spi->dev, "Panel probed\n"); 635 636 return 0; 637 } regards, dan carpenter

[PATCH] drm/xe: clean up type of GUC_HXG_MSG_0_ORIGIN

2024-01-08 Thread Dan Carpenter
The GUC_HXG_MSG_0_ORIGIN definition should be unsigned. Currently it is defined as INT_MIN. This doesn't cause a problem currently but it's still worth cleaning up. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/xe/abi/guc_messages_abi.h | 2 +- 1 file changed, 1 insertion(+),

[bug report] drm/amdgpu/vpe: enable vpe dpm

2024-01-05 Thread Dan Carpenter
-denominator : denominator); 67 68 uint16_t remainder; 69 regards, dan carpenter

[PATCH] drm/xe/device: clean up on error in probe()

2024-01-05 Thread Dan Carpenter
This error path should clean up before returning. Smatch detected this bug: drivers/gpu/drm/xe/xe_device.c:487 xe_device_probe() warn: missing unwind goto? Fixes: 4cb12b71923b ("drm/xe/xe2: Determine bios enablement for flat ccs on igfx") Signed-off-by: Dan Carpenter --- Speeking

[bug report] drm/xe: Introduce a new DRM driver for Intel GPUs

2024-01-05 Thread Dan Carpenter
/* drop reference from allocate - handle holds it now */ 2261 drm_gem_object_put(&bo->ttm.base); 2262 if (!err) 2263 args->handle = handle; 2264 return err; 2265 } regards, dan carpenter

[bug report] drm/xe: shift wrapping in xe_gem_create_ioctl()

2024-01-05 Thread Dan Carpenter
otential shift wrapping. 1917 1918 if (args->flags & DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM) { 1919 if (XE_IOCTL_DBG(xe, !(bo_flags & XE_BO_CREATE_VRAM_MASK))) 1920 return -EINVAL; 1921 1922 bo_flags |= XE_BO_NEEDS_CPU_ACCESS; 1923 } 1924 regards, dan carpenter

[PATCH] drm/xe/selftests: Fix an error pointer dereference bug

2024-01-05 Thread Dan Carpenter
Check if "bo" is an error pointer before calling xe_bo_lock() on it. Fixes: d6abc18d6693 ("drm/xe/xe2: Modify xe_bo_test for system memory") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/xe/tests/xe_bo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --g

[PATCH] drm/xe: unlock on error path in xe_vm_add_compute_exec_queue()

2024-01-05 Thread Dan Carpenter
Drop the "&vm->lock" before returning. Fixes: 24f947d58fe5 ("drm/xe: Use DRM GPUVM helpers for external- and evicted objects") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/xe/xe_vm.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/d

Re: [PATCH 1/3] drm: property: One function call less in drm_property_create() after error detection

2024-01-04 Thread Dan Carpenter
ation details out. > > That doesn't answer my question. > > Without seeing the actual Coccinelle report, I'll assume that it didn't > actually call for this change. This isn't one of the Coccinelle scripts which ship with the kernel, it's something that Markus wrote himself. regards, dan carpenter

[bug report] drm/xe: missing access_ok() in ioctl

2024-01-04 Thread Dan Carpenter
168 } 169 } 170 171 retry: 172 if (!xe_vm_in_lr_mode(vm) && xe_vm_userptr_check_repin(vm)) { 173 err = down_write_killable(&vm->lock); 174 write_locked = true; 175 } else { regards, dan carpenter

Re: [PATCH 08/11] nouveau/gsp: don't free ctrl messages on errors

2024-01-04 Thread Dan Carpenter
On Thu, Jan 04, 2024 at 10:41:50AM +1000, Dave Airlie wrote: > On Thu, 4 Jan 2024 at 00:47, Dan Carpenter wrote: > > > > Hi Dave, > > > > kernel test robot noticed the following build warnings: > > > > https://git-scm.com/docs/git-format-patch#_base_tree_

[bug report] drm/xe: Introduce a new DRM driver for Intel GPUs

2024-01-04 Thread Dan Carpenter
#x27;t have to write ", false" so much. 3) You could mark the _interruptible version as must check and the other version could be a void function. 4) Smatch could parse it automatically. I can write some custom code to parse the existing function but it's a small hassle for me. regards, dan carpenter

Re: [PATCH 08/11] nouveau/gsp: don't free ctrl messages on errors

2024-01-03 Thread Dan Carpenter
test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202312271917.55xudmdc-...@intel.com/ New smatch warnings: drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:659 r535_gsp_rpc_rm_ctrl_push() warn: passing zero to 'PTR_ERR' drivers/gpu/drm/nouveau/nvkm/engine/d

Re: [PATCH 2/2] drm/imagination: Fix error path in pvr_vm_create_context

2023-12-13 Thread Dan Carpenter
Thanks so much. Reviewed-by: Dan Carpenter regards, dan carpenter

Re: [PATCH v4 06/10] drm/panel: Add Synaptics R63353 panel driver

2023-12-06 Thread Dan Carpenter
), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202312070214.eyi9t4eq-...@intel.com/ smatch warnings: drivers/gpu/drm/panel/panel-synaptics-r63353.c:132 r63353_panel_activate() warn: missing unwind goto? vim +132 drivers

[PATCH] drm/bridge: nxp-ptn3460: simplify some error checking

2023-12-06 Thread Dan Carpenter
can never be zero, but even if it were, then I feel like this would still be the best way to write it. Fixes: 914437992876 ("drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking") Signed-off-by: Dan Carpenter --- This is not really a bug fix but I added a Fixes tag because

[PATCH] drm/imagination: Move dereference after NULL check in pvr_mmu_backing_page_init()

2023-12-06 Thread Dan Carpenter
This code dereferences "page->pvr_dev" and then checked for NULL on the next line. Re-order it to avoid a potential NULL pointer dereference. Fixes: ff5f643de0bf ("drm/imagination: Add GEM and VM related code") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/imaginatio

[bug report] drm/imagination: Implement MIPS firmware processor and MMU support

2023-12-06 Thread Dan Carpenter
nt-i-is-stupid/ https://staticthinking.wordpress.com/2023/07/25/wsign-compare-is-garbage/ You didn't ask for rants... No one ever asks for rants... 205 WRITE_ONCE(mips_data->pt[pfn], 0); 206 207 pvr_mmu_flush_request_all(pvr_dev); 208 WARN_ON(pvr_mmu_flush_exec(pvr_dev, true)); 209 210 return err; 211 } regards, dan carpenter

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

2023-12-06 Thread Dan Carpenter
ce. The pvr_vm_context_release() function has several WARN() functions that trigger if not everything is set up. It's complicated to review. So I kind of always think that people should manually kfree() things in their allocation functions and then do a kref_init() at the end. 635 636 return ERR_PTR(err); 637 } regards, dan carpenter

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

2023-12-06 Thread Dan Carpenter
C_CLRMSK); 218 pvr_cr_write32(pvr_dev, ROGUE_CR_MTS_BGCTX_THREAD1_DM_ASSOC, 219ROGUE_CR_MTS_BGCTX_THREAD1_DM_ASSOC_MASKFULL & 220 ROGUE_CR_MTS_BGCTX_THREAD1_DM_ASSOC_DM_ASSOC_CLRMSK); 221 222 /* Extra Idle checks. */ 223 err = pvr_cr_poll_reg32(pvr_dev, ROGUE_CR_BIF_STATUS_MMU, 0, regards, dan carpenter

[PATCH] drm/msm/dp: Fix platform_get_irq() check

2023-12-06 Thread Dan Carpenter
The platform_get_irq() function returns negative error codes. It never returns zero. Fix the check accordingly. Fixes: 82c2a5751227 ("drm/msm/dp: tie dp_display_irq_handler() with dp driver") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/dp/dp_display.c | 4 ++-- 1 file

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

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: 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-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)

[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

[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

[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 |

[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 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

[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

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

[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

[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

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

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

[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

[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] 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

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

[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: [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: > > > &

[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

[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

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

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] 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: [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

[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 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: 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: 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

[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: [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 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

[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

[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

[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

[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

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

[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 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

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: [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

[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

[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(+),

Re: [PATCH v4 3/3] drm/panel-simple: allow LVDS format override

2023-09-13 Thread Dan Carpenter
about this code in v3 but it looks good now. I'm not a DRM dev so I'm not sure my review counts for much. You should always just assume that if I'm quiet then I'm happy. :) regards, dan carpenter

[PATCH] drm/i915/gt: Prevent error pointer dereference

2023-09-13 Thread Dan Carpenter
Move the check for "if (IS_ERR(obj))" in front of the call to i915_gem_object_set_cache_coherency() which dereferences "obj". Otherwise it will lead to a crash. Fixes: 43aa755eae2c ("drm/i915/mtl: Update cache coherency setting for context structure") Signed-off-b

Re: [PATCH v16 15/20] drm/shmem-helper: Add memory shrinker

2023-09-07 Thread Dan Carpenter
tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202309070814.jygjojzy-...@intel.com/ smatch warnings: drivers/gpu/drm/drm_gem_shmem_helper.c:733 drm_gem_shmem_fault() error: we previously assumed 'shmem->pages' could be null

Re: [Intel-gfx] [PATCH v5 3/6] drm/i915/panelreplay: Initializaton and compute config for panel replay

2023-09-06 Thread Dan Carpenter
| Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202309060644.uwp5zw4i-...@intel.com/ smatch warnings: drivers/gpu/drm/i915/display/intel_dp.c:3779 intel_dp_vsc_sdp_pack() warn: was && intended here instead of ||? vim +3779 drivers/gpu/drm/i915

[PATCH] accel/qaic: Clean up integer overflow checking in map_user_pages()

2023-08-10 Thread Dan Carpenter
with u64 values but on 32bit systems the kmalloc() function will truncate the sizes to 32 bits. So I calculated "total = in_trans->size + offset_in_page(xfer_start_addr);" and returned -EINVAL if it were >= SIZE_MAX. This will not affect 64bit systems. Fixes: 129776ac2e38 ("accel/qa

Re: [PATCH v3 1/3] drm/display: add transparent bridge helper

2023-08-09 Thread Dan Carpenter
), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202308090559.rmlh2dl6-...@intel.com/ smatch warnings: drivers/gpu/drm/display/drm_simple_bridge.c:41 drm_simple_bridge_register() warn: possible memory leak of 'adev&

Re: [PATCH v5] accel/qaic: tighten integer overflow checking in map_user_pages()

2023-08-07 Thread Dan Carpenter
On Mon, Aug 07, 2023 at 05:09:34PM +0300, Dan Carpenter wrote: > + remaining = in_trans->size - resources->xferred_dma_size; > + total = in_trans->size + offset_in_page(xfer_start_addr); > + if (total >= SIZE_MAX) Btw, I wrote it >= instead of > to silence s

Re: [PATCH v5] accel/qaic: tighten integer overflow checking in map_user_pages()

2023-08-07 Thread Dan Carpenter
On Mon, Aug 07, 2023 at 05:09:34PM +0300, Dan Carpenter wrote: > The encode_dma() function has some validation on in_trans->size but it's > not complete and it would be more clear to move those checks to > find_and_map_user_pages(). > > The encode_dma() had two checks:

[PATCH v5] accel/qaic: tighten integer overflow checking in map_user_pages()

2023-08-07 Thread Dan Carpenter
not overflow. My other concern was that we are dealing with u64 values but on 32bit systems the kmalloc() function will truncate the sizes to 32 bits. So I calculated "total = in_trans->size + offset_in_page(xfer_start_addr);" and returned -EINVAL if it were >= SIZE_MAX. This w

Re: [PATCH v3 4/9] PM / QoS: Decouple request alloc from dev_pm_qos_mtx

2023-08-04 Thread Dan Carpenter
add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202308041725.npwswh0l-...@intel.com/ smatch warnings: drivers/base/power/qos.c:973 dev_pm_qos_update_user_latency_tolerance() warn: possible memory leak of 'req' vim

Re: [PATCH v3 3/3] drm/panel-simple: allow LVDS format override

2023-07-28 Thread Dan Carpenter
, > panel); > + if (ret) > + goto free_ddc; This *looks* like we are returning an error but we aren't. I think we should be. If not then we need to have a discussion about that and add some comments. regards, dan carpenter > + } > + >

Re: [Intel-gfx] [PATCH v2] drm/i915/tv: avoid possible division by zero

2023-07-25 Thread Dan Carpenter
On Wed, Jul 26, 2023 at 09:21:50AM +0800, Su Hui wrote: > On 2023/7/25 13:51, Dan Carpenter wrote: > > The reason why the first five attempts had bugs is because we are > > trying to write it in the most complicated way possible, shifting by > > logical not what? > Wond

Re: [Intel-gfx] [PATCH v2] drm/i915/tv: avoid possible division by zero

2023-07-24 Thread Dan Carpenter
The reason why the first five attempts had bugs is because we are trying to write it in the most complicated way possible, shifting by logical not what? regards, dan carpenter diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c index 36b479b46b60

<    1   2   3   4   5   6   7   8   9   10   >