[PATCH] amdgpu/pm: prevent array underflow in vega20_odn_edit_dpm_table()

2022-11-15 Thread Dan Carpenter
In the PP_OD_EDIT_VDDC_CURVE case the "input_index" variable is capped at 2 but not checked for negative values so it results in an out of bounds read. This value comes from the user via sysfs. Fixes: d5bf26539494 ("drm/amd/powerplay: added vega20 overdrive support V3"

Re: [PATCH v1 2/2] drm/gem: Check whether object is NULL in drm_gem_vunmap()

2022-10-27 Thread Dan Carpenter
; > support to drm_gem_vunmap function because the mapping argument was always > > NULL together with the object. Make drm_gem_vunmap() functions to handle > > the NULL pointers better. > > > > Reported-by: Dan Carpenter > > Link: https://lore.kernel.org/dri-d

[bug report] drm/gem: Add drm_gem_object_funcs

2022-10-26 Thread Dan Carpenter
ffer->handle) 244 drm_mode_destroy_dumb(dev, buffer->handle, buffer->client->file); 245 246 kfree(buffer); 247 } regards, dan carpenter

[bug report] drm/bridge: it6505: Adapt runtime power management framework

2022-10-25 Thread Dan Carpenter
t6505->bridge.dev); 2719 memset(it6505->dpcd, 0, sizeof(it6505->dpcd)); 2720 DRM_DEV_DEBUG_DRIVER(dev, "power off it6505 success!"); 2721 } 2722 2723 unlock: 2724 mutex_unlock(&it6505->extcon_lock); 2725 } regards, dan carpenter

[bug report] dma-buf: Move dma_buf_attach() to dynamic locking specification

2022-10-25 Thread Dan Carpenter
1008 dmabuf->ops->unpin(attach); 1009 } 1010 list_del(&attach->node); 1011 1012 dma_resv_unlock(dmabuf->resv); 1013 1014 if (dmabuf->ops->detach) 1015 dmabuf->ops->detach(dmabuf, attach); 1016 1017 kfree(attach); 1018 } regards, dan carpenter

[PATCH v2] virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()

2022-09-18 Thread Dan Carpenter
irtio: implement context init: add virtio_gpu_fence_event") Signed-off-by: Dan Carpenter --- v2: Style change. Use BIT_ULL(). drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm

Re: [PATCH] virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()

2022-09-15 Thread Dan Carpenter
On Thu, Sep 15, 2022 at 05:45:46PM -0700, Chia-I Wu wrote: > On Thu, Sep 15, 2022 at 4:14 AM Dan Carpenter > wrote: > > > > The ->ring_idx_mask variable is a u64 so static checkers, Smatch in > > this case, complain if the BIT() is not also a u64. > > > >

[PATCH] virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()

2022-09-15 Thread Dan Carpenter
irtio: implement context init: add virtio_gpu_fence_event") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 3b17

[PATCH] drm/sprd: remove pointless assignment

2022-09-12 Thread Dan Carpenter
There is no need for the "video_size_step" variable. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/sprd/sprd_dsi.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/sprd/sprd_dsi.c b/drivers/gpu/drm/sprd/sprd_dsi.c index 12b67a5d5923..c8

[PATCH] drm/i915: prevent integer overflow in query_engine_info()

2022-09-01 Thread Dan Carpenter
This code uses struct_size() but it stores the result in an int so the integer overflow checks are not effective. Record the types as size_t to prevent the size from being truncated. Fixes: bf3c50837506 ("drm/i915/query: Use struct_size() helper") Signed-off-by: Dan Carpenter --- I d

dri-devel@lists.freedesktop.org

2022-08-30 Thread Dan Carpenter
-ci/archive/20220830/202208301957.ulaot2oy-...@intel.com/config) compiler: gcc-11 (Debian 11.3.0-5) 11.3.0 If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c:497

Re: [PATCH] drm/tve200: Fix smatch warning

2022-08-26 Thread Dan Carpenter
an explicit error return code to make this unambiguous. > > > > Reported-by: Dan Carpenter > > Signed-off-by: Linus Walleij > > Would someone show mercy on this patch and review it so I > can apply it? > > Dan maybe? If it solves the problem you reported.

Re: [PATCH] msm/adreno: fix repeated words in comments

2022-08-26 Thread Dan Carpenter
at the beginning of the commit message, > - add a correct Fixes tag. This doesn't fix a bug so the fixes tag is inappropriate. regards, dan carpenter

Re: [bug report] drm/ttm: Fix dummy res NULL ptr deref bug

2022-08-11 Thread Dan Carpenter
On Thu, Aug 11, 2022 at 04:36:33PM +0530, Arunpravin Paneer Selvam wrote: > Hi Dan, > > drm-misc-fixes doesn't have the updated ttm_bo.c file, we have the updated > ttm_bo.c version in > drm-misc-next branch. Please find below for the line number 907. > > On 8/11/2

[bug report] drm/ttm: Fix dummy res NULL ptr deref bug

2022-08-11 Thread Dan Carpenter
rnel.org but there is no Fixes tag. 916 ret = ttm_tt_create(bo, true); 917 if (ret) regards, dan carpenter

[PATCH] drm/nouveau/clk: fix end of loop test in nvkm_clk_ustate_update()

2022-08-10 Thread Dan Carpenter
If list_for_each_entry() exits without hitting a break then "pstate" is not a valid pstate pointer. Introduce a "found" variable instead. Fixes: 7c8565220697 ("drm/nouveau/clk: implement power state and engine clock control in core") Signed-off-by: Dan Carpenter

Re: [PATCH v3] staging: fbtft: core: set smem_len before fb_deferred_io_init call

2022-07-28 Thread Dan Carpenter
the code. > > > > > Fixes: 856082f021a2 ("fbdev: defio: fix the pagelist corruption") > > Don't agree with such description. I don't see how you can disagree? Before your patch the fb_deferred_io_init() did not use info->fix.smem_len and now it does. regards, dan carpenter

Re: [PATCH] staging: fbtft: core: set smem_len before fb_deferred_io_init call

2022-07-26 Thread Dan Carpenter
e pagelist corruption") Signed-off-by: Make sure you CC the original author (Chuansheng Liu) so they can review the bug fix. Google used to give good guides for how to send a v2 patch but now the first page is just useless. :/ regards, dan carpenter > Signed-off-by: Peter Suti

[PATCH] drm/vmwgfx: clean up some error pointer checking

2022-07-19 Thread Dan Carpenter
: drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:1177 vmw_translate_mob_ptr() warn: passing zero to 'PTR_ERR' drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:1314 vmw_cmd_dx_bind_query() error: uninitialized symbol 'vmw_bo'. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/vmwgfx/vmw

Re: [linux-next:master] BUILD REGRESSION 088b9c375534d905a4d337c78db3b3bfbb52c4a0

2022-07-08 Thread Dan Carpenter
OR: from is NULL but dereferenced. drivers/android/binder.c:2920:29-33: ERROR: target_thread is NULL but dereferenced. drivers/android/binder.c:353:25-35: ERROR: node -> proc is NULL but dereferenced. drivers/android/binder.c:4888:16-20: ERROR: t is NULL but dereferenced. regards, dan carpenter

[PATCH v2] drm/bridge: Avoid uninitialized variable warning

2022-07-04 Thread Dan Carpenter
bits to support bus format negotiation") Signed-off-by: Dan Carpenter --- v2: initialize the variable instead, this keeps the original error codes. drivers/gpu/drm/drm_bridge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/

Re: [PATCH] drm/bridge: Avoid uninitialized variable warning

2022-06-28 Thread Dan Carpenter
On Tue, Jun 28, 2022 at 09:26:09AM +0200, Boris Brezillon wrote: > On Tue, 28 Jun 2022 09:59:51 +0300 > Dan Carpenter wrote: > > > This works, but technically it uses "num_in_bus_fmts" before it has been > > initialized so it leads to static checker warnings and p

[PATCH] drm/bridge: Avoid uninitialized variable warning

2022-06-28 Thread Dan Carpenter
quot;drm/bridge: Add the necessary bits to support bus format negotiation") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/drm_bridge.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index e275b4

Re: [bug report] drm: Add support for the LogiCVC display controller

2022-06-26 Thread Dan Carpenter
On Fri, Jun 24, 2022 at 04:53:25PM +0200, Paul Kocialkowski wrote: > Hello Dan, > > On Tue 14 Jun 22, 15:07, Dan Carpenter wrote: > > Hello Paul Kocialkowski, > > > > The patch efeeaefe9be5: "drm: Add support for the LogiCVC display > > controller"

[PATCH] drm/vc4: fix error code in vc4_check_tex_size()

2022-06-22 Thread Dan Carpenter
The vc4_check_tex_size() function is supposed to return false on error but this error path accidentally returns -ENODEV (which means true). Fixes: 30f8c74ca9b7 ("drm/vc4: Warn if some v3d code is run on BCM2711") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/vc4/vc4_validate.c | 2

[PATCH] drm: fix an error code in drm_syncobj_transfer_to_timeline()

2022-06-14 Thread Dan Carpenter
Return -ENOMEM instead of success if dma_fence_unwrap_merge() fails. Fixes: ec8d985ff26f ("drm: use dma_fence_unwrap_merge() in drm_syncobj") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/drm_syncobj.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drive

[PATCH] drm: logicvc: fix error code in logicvc_layer_init()

2022-06-14 Thread Dan Carpenter
Return -EINVAL if logicvc_layer_formats_lookup() fails. Don't return success. Fixes: efeeaefe9be5 ("drm: Add support for the LogiCVC display controller") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/logicvc/logicvc_layer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/

[PATCH] drm: logicvc: Fix uninitialized variable in probe

2022-06-14 Thread Dan Carpenter
The "regmap" is supposed to be initialized to NULL but it's used without being initialized. Fixes: efeeaefe9be5 ("drm: Add support for the LogiCVC display controller") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/logicvc/logicvc_drm.c | 2 +- 1 file changed, 1

[bug report] drm: Add support for the LogiCVC display controller

2022-06-14 Thread Dan Carpenter
ot;- voffset = 0x%x chunks of 0x%x bytes\n", voffset, 339 layer_stride); 340 drm_dbg_kms(drm_dev, "- hoffset = 0x%x chunks of 0x%x bytes\n", hoffset, 341 layer_bytespp); 342 343 if (setup) { 344 setup->buffer_sel = buffer_sel; 345 setup->voffset = voffset; 346 setup->hoffset = hoffset; 347 } 348 349 return 0; 350 } regards, dan carpenter

Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-26 Thread Dan Carpenter
On Thu, May 26, 2022 at 03:28:25PM +0100, Matthew Wilcox wrote: > On Thu, May 26, 2022 at 11:48:32AM +0300, Dan Carpenter wrote: > > On Thu, May 26, 2022 at 02:16:34AM +0100, Matthew Wilcox wrote: > > > Bizarre this started showing up now. The recent patch was: > > >

Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-26 Thread Dan Carpenter
() and folio_order() are 0-255. I guess because of the "unsigned char compound_order;" in the struct page. regards, dan carpenter

Re: [linux-next:master] BUILD REGRESSION 8cb8311e95e3bb58bd84d6350365f14a718faa6d

2022-05-26 Thread Dan Carpenter
> > so the RHS here should have unsigned long type. Being able to generate > the cpp output would be helpful. That requires the .config. The heuristic is that "inode->i_blocks" is a u64 but this .config must be for a 32bit CPU. I'm just going to turn off all these warnings until I can figure out a better heuristic. regards, dan carpenter

Re: [PATCH] udmabuf: Set the DMA mask for the udmabuf device

2022-05-23 Thread Dan Carpenter
/202205210319.ovui0mkr-...@intel.com/config) compiler: gcc-11 (Debian 11.3.0-1) 11.3.0 If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/dma-buf/udmabuf.c:383 udmabuf_dev_init() warn: '&udmabuf_m

Re: [bug report] dma-buf: call dma_buf_stats_setup after dmabuf is in valid list

2022-05-16 Thread Dan Carpenter
se positive. On closing the file @line no:567, it > > ends up calling dma_buf_file_release() which does remove dmabuf from its > > list. > > Yeah, correct as far as I can see. The checker just can't see that the fput > will cleanup the list. Yep. Thanks! I hope that that Smatch will be better at parsing the fput() by the end of the year but right now it doesn't work at all. regards, dan carpenter

[bug report] dma-buf: call dma_buf_stats_setup after dmabuf is in valid list

2022-05-15 Thread Dan Carpenter
ULL; 567 fput(file); 568 err_dmabuf: 569 kfree(dmabuf); dmabuf is freed, but it's still on the list so it leads to a use after free. 570 err_module: 571 module_put(exp_info->owner); 572 return ERR_PTR(ret); 573 } regards, dan carpenter

Re: [bug report] drm/msm: devcoredump iommu fault support

2022-05-12 Thread Dan Carpenter
On Mon, May 09, 2022 at 07:48:23AM -0700, Rob Clark wrote: > On Sun, May 8, 2022 at 11:28 PM Dan Carpenter > wrote: > > 407 } else { > > 408 /* > > 409 * We couldn't attribute this fault to any > &

Re: [PATCH 3/3] drm/virtio: use the fence for every plane update

2022-05-11 Thread Dan Carpenter
/202205112132.fqtvzlwa-...@intel.com/config) compiler: hppa-linux-gcc (GCC) 11.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/virtio/virtgpu_plane.c:158 virtio_gpu_resource_flush() error

[PATCH] drm/rockchip: vop2: unlock on error path in vop2_crtc_atomic_enable()

2022-05-09 Thread Dan Carpenter
This error path needs an unlock before returning. Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/d

[bug report] drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback

2022-05-09 Thread Dan Carpenter
260 261 if (!conn_state || !conn_state->connector) { 262 DPU_ERROR("invalid connector state\n"); 263 return -EINVAL; 264 } else if (conn_state->connector->status != 265 connector_status_connected) { regards, dan carpenter

[bug report] drm/msm: devcoredump iommu fault support

2022-05-08 Thread Dan Carpenter
l the rings with the latest and greatest fence.. this 425 * needs to happen after msm_rd_dump_submit() to ensure that the 426 * bo's referenced by the offending submit are still around. 427 */ regards, dan carpenter

Re: [PATCH] drm/mgag200: Fail on I2C initialization errors

2022-05-06 Thread Dan Carpenter
.eyvqwrst-...@intel.com/config) compiler: gcc-11 (Debian 11.2.0-20) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/mgag200/mgag200_mode.c:819 mgag200_vga_connector_init() error

[PATCH] drm/msm: return an error pointer in msm_gem_prime_get_sg_table()

2022-05-05 Thread Dan Carpenter
The msm_gem_prime_get_sg_table() needs to return error pointers on error. This is called from drm_gem_map_dma_buf() and returning a NULL will lead to a crash in that function. Fixes: ac45146733b0 ("drm/msm: fix msm_gem_prime_get_sg_table()") Signed-off-by: Dan Carpenter --- drivers/g

[PATCH] drm/sun4i: dsi: delete unnecessary IS_ERR() checks

2022-04-28 Thread Dan Carpenter
The "dsi->bus_clk" pointer cannot be an error pointer at this point. The check is confusing and unnecessary. Delete it. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/

Re: [PATCH v3 1/5] fbdev: Put mmap for deferred I/O into drivers

2022-04-28 Thread Dan Carpenter
-...@intel.com/config) compiler: gcc-11 (Debian 11.2.0-20) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/video/fbdev/core/fbmem.c:1389 fb_mmap() warn: inconsistent returns '

[PATCH 2/2] drm/amdgpu: debugfs: fix NULL dereference in ta_if_invoke_debugfs_write()

2022-04-26 Thread Dan Carpenter
If the kzalloc() fails then this code will crash. Return -ENOMEM instead. Fixes: e50d9ba0d2cd ("drm/amdgpu: Add debugfs TA load/unload/invoke support") Signed-off-by: Dan Carpenter --- This would look nicer as: shared_buf = memdup_user(&buf[copy_pos], shared_buf_le

[PATCH 1/2] drm/amdgpu: debugfs: fix error codes in write functions

2022-04-26 Thread Dan Carpenter
d2cd ("drm/amdgpu: Add debugfs TA load/unload/invoke support") Signed-off-by: Dan Carpenter --- There are a bunch of exit paths where copy_from_user() fails and this function returns -EINVAL which is wrong as well. If the copy fails it should be -EFAULT. If the data is bad, then -EINVA

[bug report] drm/ttm: Add a generic TTM memcpy move for page-based iomem

2022-04-13 Thread Dan Carpenter
260 261 WARN_ON(ret); 262 } regards, dan carpenter

Re: [PATCH v18 03/10] soc: mediatek: add mtk-mmsys support for mt8195 vdosys0

2022-04-12 Thread Dan Carpenter
e/20220413/202204130935.urqkcdrg-...@intel.com/config) compiler: arc-elf-gcc (GCC) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/soc/mediatek/mtk-mmsys.c:315 mtk_mmsys_probe() warn: passi

[PATCH] drm/vmwgfx: remove bogus NULL check

2022-04-12 Thread Dan Carpenter
uninitialized variable in the caller. drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:1314 vmw_cmd_dx_bind_query() error: uninitialized symbol 'vmw_bo'. So clean this code up and silence then static checker warnings by removing the bogus NULL check. Signed-off-by: Dan Carpenter --- drivers/gpu/

Re: [PATCH] drm/exynos: fix IS_ERR() vs NULL check in probe

2022-04-11 Thread Dan Carpenter
On Tue, Apr 12, 2022 at 10:01:20AM +0900, Inki Dae wrote: > Hi Dan Carpenter. > > Same patch[1] was posted so I will pick it up. > > [1] https://www.spinics.net/lists/arm-kernel/msg967488.html > It's not the same. That one returns -EINVAL and mine returns -EPRO

Re: [PATCH] drm: mxsfb: Implement LCDIF scanout CRC32 support

2022-04-11 Thread Dan Carpenter
/202204111055.eteht46w-...@intel.com/config) compiler: gcc-11 (Debian 11.2.0-19) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/mxsfb/mxsfb_kms.c:444 mxsfb_crtc_set_crc_source() warn: variable

[PATCH] drm/exynos: fix IS_ERR() vs NULL check in probe

2022-04-08 Thread Dan Carpenter
The of_drm_find_bridge() does not return error pointers, it returns NULL on error. Fixes: dd8b6803bc49 ("exynos: drm: dsi: Attach in_bridge in MIC driver") Signed-off-by: Dan Carpenter --- -EPROBE_DEFER is the correct return, right? drivers/gpu/drm/exynos/exynos_drm_mic.c | 4 ++

[bug report] drm/tve200: Clean up panel bridging

2022-04-01 Thread Dan Carpenter
drm_kms_helper_poll_init(dev); 127 128 goto finish; 129 130 out_bridge: 131 if (panel) 132 drm_panel_bridge_remove(bridge); 133 drm_mode_config_cleanup(dev); 134 finish: 135 return ret; 136 } regards, dan carpenter

Re: [PATCH 3/3] drm/msm: Add a way to override processes comm/cmdline

2022-03-18 Thread Dan Carpenter
dup(task->comm, GFP_KERNEL); > > > > What? > > > > If the first allocation failed, then this one is going to fail as well. > > Just return -ENOMEM. Or maybe this is meant to be checking for an empty > > string? > > fwiw, if ctx->comm is NULL, the kstrdup() will return NULL, so this > isn't intended to deal with OoM, but the case that comm and/or cmdline > is not overridden. Ah, I should have thought about that. Thanks! regards, dan carpenter

Re: [PATCH 3/3] drm/msm: Add a way to override processes comm/cmdline

2022-03-17 Thread Dan Carpenter
NOMEM. Or maybe this is meant to be checking for an empty string? > + > + if (!*cmd) > + *cmd = kstrdup_quotable_cmdline(task, GFP_KERNEL); Same. > > put_task_struct(task); > } regards, dan carpenter

[PATCH] drm/amdgpu: fix off by one in amdgpu_gfx_kiq_acquire()

2022-03-16 Thread Dan Carpenter
This post-op should be a pre-op so that we do not pass -1 as the bit number to test_bit(). The current code will loop downwards from 63 to -1. After changing to a pre-op, it loops from 63 to 0. Fixes: 71c37505e7ea ("drm/amdgpu/gfx: move more common KIQ code to amdgpu_gfx.c") Signed-o

Re: [PATCH] drm/selftests: missing error code in igt_buddy_alloc_smoke()

2022-03-07 Thread Dan Carpenter
ning a legal document to say that you have not stolen anyone else's copyrighted works (SCO lawsuit). So it should be whatever name you use to sign legal documents. regards, dan carpenter

Re: [PATCH 0/6] Remove usage of list iterator past the loop body

2022-03-07 Thread Dan Carpenter
ly other places which rely on the old behavior. In an ideal world, with the new API the compiler would warn about uninitialized variables, but unfortunately that warning is disabled by default so we still have to rely on kbuild/Clang/Smatch to find the bugs. But hopefully the new API encourages people to write clearer code so it prevents bugs in the long run. regards, dan carpenter

[PATCH] drm/msm/adreno: fix cast in adreno_get_param()

2022-03-07 Thread Dan Carpenter
These casts need to happen before the shift. The only time it would matter would be if "rev.core" is >= 128. In that case the sign bit would be extended and we do not want that. Fixes: afab9d91d872 ("drm/msm/adreno: Expose speedbin to userspace") Signed-off-by: Dan Carp

[PATCH] drm/selftests: missing error code in igt_buddy_alloc_smoke()

2022-03-07 Thread Dan Carpenter
Set the error code to -ENOMEM if drm_random_order() fails. Fixes: e6ff5ef81170 ("drm/selftests: add drm buddy smoke testcase") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/selftests/test-drm_buddy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drive

Re: [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-03 Thread Dan Carpenter
.c index ddf5737c63d9..c9dffa5c40a2 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -3771,6 +3771,9 @@ EXPORT_SYMBOL(kmem_cache_free_bulk); * * Don't free memory not originally allocated by kmalloc() * or you will run into trouble. + * + * CHECKER information + * frees: $0 */ void kfree(const void *objp) { regards, dan carpenter

Re: [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-03 Thread Dan Carpenter
^^^ 425 426 for (port = 0; port < r8a66597->max_root_hub; port++) { 427 if (r8a66597->root_hub[port].dev == dev) { ^^^ 428 r8a66597->root_hub[port].dev = NULL; 429 break; 430 } 431 } Printing the freed pointer in debug code is another thing people do. regards, dan carpenter

[PATCH] ASoC: qcom: Fix error code in lpass_platform_copy()

2022-03-01 Thread Dan Carpenter
c dma driver") Signed-off-by: Dan Carpenter --- sound/soc/qcom/lpass-platform.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index bf180a594c19..620312529c2f 100644 --- a/sound/soc/

Re: [PATCH 1/6] drivers: usb: remove usage of list iterator past the loop body

2022-02-28 Thread Dan Carpenter
On Mon, Feb 28, 2022 at 10:20:28AM -0800, Joe Perches wrote: > On Mon, 2022-02-28 at 14:24 +0300, Dan Carpenter wrote: > > > a multi-line indent gets curly braces for readability even though > > it's not required by C. And then both sides would get curly braces. > &

Re: [PATCH 1/6] drivers: usb: remove usage of list iterator past the loop body

2022-02-28 Thread Dan Carpenter
een what is a related part of a patch is a bit vague and some maintainers will ask you to add or subtract from a patch depending on their individual tastes. I don't really have an exact answer, but I felt like this patch needs to be subtracted from. Especially if there is a whole chunk of the patch which can be removed, then to me, that obviously should be in a different patch. regards, dan carpenter

Re: [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-02-28 Thread Dan Carpenter
dev_name(&_phy->dev)); > BUG(); > } > } else { > - sas_port_create_link(port, phy); > - list_add_tail(&phy->port_siblings, &port->phy_list); > + s

Re: [PATCH 6/6] treewide: remove check of list iterator against head past the loop body

2022-02-28 Thread Dan Carpenter
nse, but it's out of date now. Just delete it. > - if (group && &group->list == &rcd->tid_group_list.list) > + if (!group) > goto bail_eagain; > group = list_prepare_entry(group, &rcd->tid_group_list.list, > list); regards, dan carpenter

Re: [PATCH 3/6] treewide: fix incorrect use to determine if list is empty

2022-02-28 Thread Dan Carpenter
-- > drivers/media/pci/saa7134/saa7134-alsa.c | 4 ++-- > drivers/perf/xgene_pmu.c | 13 +++-- > 3 files changed, 11 insertions(+), 10 deletions(-) These are all bug fixes. 1) Send them as 3 separate patches. 2) Add Fixes tags. regards, dan carpenter

Re: [PATCH 1/6] drivers: usb: remove usage of list iterator past the loop body

2022-02-28 Thread Dan Carpenter
break; > + } > } > - if (&req->req != _req) { > + if (!req) { > ep->stopped = stopped; > spin_unlock_irqrestore(&ep->dev->lock, flags); > return -EINVAL; > @@ -954,7 +957,6 @@ net2272_dequeue(struct usb_ep *_ep, struct usb_request > *_req) > dev_dbg(ep->dev->dev, "unlink (%s) pio\n", _ep->name); > net2272_done(ep, req, -ECONNRESET); > } > - req = NULL; Another unrelated change. These are all good changes but send them as separate patches. > ep->stopped = stopped; > > spin_unlock_irqrestore(&ep->dev->lock, flags); regards, dan carpenter

[bug report] drm/amdkfd: CRIU checkpoint and restore queue mqds

2022-02-17 Thread Dan Carpenter
ata_size); 803if (ret) { 804ret = -EFAULT; 805 goto exit; 806} regards, dan carpenter

Re: [PATCH 2/2] fbdev: Don't sort deferred-I/O pages by default

2022-02-10 Thread Dan Carpenter
sonal style is to have the likely part first. > This makes reading the code easier. I've thought about this quite a bit... I guess my rule is to avoid negatives as much as possible so I prefer the original code. My rules right now are: 1) Always do error handling. Don't do success handling. 2) Return as quickly as possible and pull the code in an indent. 3) Avoid negatives. Never had negatives in the variable names. regards, dan carpenter

[PATCH] drm/amdkfd: CRIU return -EFAULT for copy_to_user() failure

2022-02-09 Thread Dan Carpenter
If copy_to_user() fails, it returns the number of bytes remaining to be copied but we want to return a negative error code (-EFAULT) to the user. Fixes: 9d5dabfeff3c ("drm/amdkfd: CRIU Save Shared Virtual Memory ranges") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdkfd/kfd

[PATCH] drm/amdkfd: CRIU fix a NULL vs IS_ERR() check

2022-02-09 Thread Dan Carpenter
The kfd_process_device_data_by_id() does not return error pointers, it returns NULL. Fixes: bef153b70c6e ("drm/amdkfd: CRIU implement gpu_id remapping") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

Re: [PATCH v6 1/3] drm/lsdc: add drm driver for loongson display controller

2022-02-03 Thread Dan Carpenter
On Thu, Feb 03, 2022 at 12:29:11PM +0100, Krzysztof Kozlowski wrote: > On Thu, 3 Feb 2022 at 12:08, Dan Carpenter wrote: > > > > > > This does not look like compliant with GPL-2.0. You cannot call a > > > license GPL-2.0 and restrict it with some other provisions.

Re: [PATCH v6 1/3] drm/lsdc: add drm driver for loongson display controller

2022-02-03 Thread Dan Carpenter
shall be included in all copies or substantial portions > > + * of the Software. > > This does not look like compliant with GPL-2.0. You cannot call a > license GPL-2.0 and restrict it with some other provisions. That's the MIT license. It's not the GPL-2.0 license but it is compliant. regards, dan carpenter

Re: [PATCH v1 0/4] fbtft: Unorphan the driver for maintenance

2022-01-26 Thread Dan Carpenter
On Wed, Jan 26, 2022 at 11:31:02PM +0100, Daniel Vetter wrote: > dOn Wed, Jan 26, 2022 at 3:46 PM Dan Carpenter > wrote: > > > > The other advantage of staging is the I don't think syzbot enables it. > > I guess it's easier to persuade Dmitry to ignore STA

Re: [PATCH v1 0/4] fbtft: Unorphan the driver for maintenance

2022-01-26 Thread Dan Carpenter
the kernel. regards, dan carpenter

Re: [PATCH v1 0/4] fbtft: Unorphan the driver for maintenance

2022-01-26 Thread Dan Carpenter
re > supported by tiny DRM and see about interfaces). Could we get an exact list? regards, dan carpenter

[PATCH] drm/i915/overlay: Prevent divide by zero bugs in scaling

2022-01-24 Thread Dan Carpenter
g() error: potential divide by zero bug '/ rec->dst_width'. Prevent this by ensuring that the dst height and width are non-zero. Fixes: 02e792fbaadb ("drm/i915: implement drmmode overlay support v4") Signed-off-by: Dan Carpenter --- >From static analysis. Not

[bug report] drm/ast: Handle failed I2C initialization gracefully

2022-01-06 Thread Dan Carpenter
1234 kfree(edid); 1235 return ret; 1236 } 1237 drm_connector_update_edid_property(&ast_connector->base, NULL); 1238 return 0; 1239 } regards, dan carpenter

Re: [PATCH] drm/panfrost: Avoid user size passed to kvmalloc()

2021-12-17 Thread Dan Carpenter
On Fri, Dec 17, 2021 at 09:16:19AM +, Steven Price wrote: > On 17/12/2021 09:10, Dan Carpenter wrote: > > On Fri, Dec 17, 2021 at 08:55:50AM +, Steven Price wrote: > >> However this one is harder to fix without setting an arbitrary cap on > >> the number of B

Re: [PATCH] drm/panfrost: Avoid user size passed to kvmalloc()

2021-12-17 Thread Dan Carpenter
64 and SIZE_MAX is ULONG_MAX so the (sz > SIZE_MAX) condition does work to prevent an integer overflow on 32bit systems. But it's not beautiful. regards, dan carpenter

Re: [PATCH] drm/panfrost: Avoid user size passed to kvmalloc()

2021-12-16 Thread Dan Carpenter
hat is going to be a requirement at some point. regards, dan carpenter

[bug report] new kvmalloc() WARN() triggered by DRM ioctls tracking

2021-12-16 Thread Dan Carpenter
ideally if this could be fixed in a central way, but if not then hopefully I've added the relevant lists to the CC. regards, dan carpenter

[PATCH] drm/msm/dp: Fix double free on error in msm_dp_bridge_init()

2021-12-15 Thread Dan Carpenter
The "dp_bridge" pointer is allocated with devm_kzalloc() so it will be freed automatically. Kfreeing it here will only lead to a double free. Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable") Signed-off-by: Dan Carpenter --- dr

[bug report] drm/sprd: add Unisoc's drm kms master

2021-12-15 Thread Dan Carpenter
return; 160} 161 162drm_atomic_helper_shutdown(drm); 163} regards, dan carpenter

[bug report] drm/vmwgfx: Implement DRIVER_GEM

2021-12-15 Thread Dan Carpenter
; 574 ttm_bo_put(&vmw_bo->base); ^ Smatch thinks it can fail. 575 576 return ret; 577 } regards, dan carpenter

[PATCH v2] fbdev: savagefb: make a variable local

2021-12-07 Thread Dan Carpenter
The "edid" struct member is only used during probe() and it's freed right away. There is no point in storing a freed pointer for the whole life of the driver. Signed-off-by: Dan Carpenter --- v2: use __maybe_unused annotation to silence an unused variable warning depending

Re: [PATCH] drm: Return error codes from struct drm_driver.gem_create_object

2021-12-07 Thread Dan Carpenter
pdated all the drivers. But somehow the vc4 chunk from your patch was dropped. It was *NOT* dropped by Stephen Rothwell. It got dropped earlier. I am including the `git format-patch -1 ` output from the commit. regards, dan carpenter >From 4ff22f487f8c26b99cbe1678344595734c001a39 Mon Sep 17

Re: [PATCH] drm: Return error codes from struct drm_driver.gem_create_object

2021-12-06 Thread Dan Carpenter
On Mon, Dec 06, 2021 at 12:16:24PM +0100, Thomas Zimmermann wrote: > Hi > > Am 06.12.21 um 11:42 schrieb Dan Carpenter: > > On Tue, Nov 30, 2021 at 10:52:55AM +0100, Thomas Zimmermann wrote: > > > GEM helper libraries use struct drm_driver.gem_create_object to let &g

Re: [PATCH 1/3] drm/ast: Handle failed I2C initialization gracefully

2021-12-06 Thread Dan Carpenter
-...@intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/ast/ast_mode.c:1231 ast_get_modes() error: uninitialized symbol 'edid'

Re: [PATCH] drm: Return error codes from struct drm_driver.gem_create_object

2021-12-06 Thread Dan Carpenter
e and build but it will break at runtime. For now, it's only vc4_create_object() which is broken. regards, dan carpenter

[PATCH] video: fbdev: atmel_lcdfb: fix an error code in atmel_lcdfb_probe()

2021-12-03 Thread Dan Carpenter
If "sinfo->config" is not found, then return -ENODEV. Don't return success. Fixes: b985172b328a ("video: atmel_lcdfb: add device tree suport") Signed-off-by: Dan Carpenter --- drivers/video/fbdev/atmel_lcdfb.c | 11 ++- 1 file changed, 6 insertions(+),

[PATCH] fbdev: savagefb: make a variable local

2021-12-03 Thread Dan Carpenter
The "edid" struct member is only used during probe() and it's freed right away. There is no point in storing a freed pointer for the whole life of the driver. Signed-off-by: Dan Carpenter --- drivers/video/fbdev/savage/savagefb.h | 1 - drivers/video/fbdev/savage/savage

[bug report] drm/msm/a6xx: Fix llcc configuration for a660 gpu

2021-11-25 Thread Dan Carpenter
GBIF_SCACHE_CNTL0, (0x1f << 10) | --> 1480 (1 << 8), (gpu_scid << 10) | (1 << 8)); ^^ Uninitialized if llcc_slice_activate() failed. 1481 } regards, dan carpenter

[PATCH] drm/bridge: anx7625: fix an error code in anx7625_register_audio()

2021-11-24 Thread Dan Carpenter
This code accidentally returns IS_ERR(), which is 1, instead of propagating the negative error code. The caller doesn't check for errors so it doesn't affect run time at all. Fixes: 566fef1226c1 ("drm/bridge: anx7625: add HDMI audio function") Signed-off-by: Dan Carpenter

[PATCH] drm/i915/gvt: Prevent integer overflow in intel_vgpu_emulate_cfg_write()

2021-11-24 Thread Dan Carpenter
The "offset" is a u32 that comes from the user. The bug is that the "offset + bytes" operation can have an integer overflow problem which leads to an out of bounds access. Fixes: 4d60c5fd3f87 ("drm/i915/gvt: vGPU PCI configuration space virtualization"

[PATCH] drm/i915/ttm: Fix error code in i915_ttm_eviction_valuable()

2021-11-21 Thread Dan Carpenter
This function returns a bool type so returning -EBUSY is equivalent to returning true. It should return false instead. Fixes: 7ae034590cea ("drm/i915/ttm: add tt shmem backend") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 2 +- 1 file changed, 1 inser

[bug report] drm/panel: Add BOE BF060Y8M-AJ0 5.99" AMOLED panel driver

2021-11-18 Thread Dan Carpenter
ret) 352 dev_dbg(dev, "Current limit cannot be set on %s: %d\n", 353 boe->vregs[1].supply, ret); 354 355 vreg = boe->vregs[BF060Y8M_VREG_VCI].consumer; 356 ret = regulator_set_current_limit(vreg, 2, 4);

[PATCH v2] drm/virtio: Fix an NULL vs IS_ERR() bug in virtio_gpu_object_shmem_init()

2021-11-18 Thread Dan Carpenter
The drm_gem_shmem_get_sg_table() function never returns NULL. It returns error pointers on error. Fixes: c66df701e783 ("drm/virtio: switch from ttm to gem shmem helpers") Signed-off-by: Dan Carpenter --- v2: I originally sent this patch on 19 Jun 2020 but it was somehow not appl

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