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

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

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

2022-06-14 Thread Dan Carpenter
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
der() 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
nsigned 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: '_misc' from

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

2022-05-16 Thread Dan Carpenter
sitive. 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-16 Thread Dan Carpenter
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 > > p

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
61 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-09 Thread Dan Carpenter
* 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 '>mm_l

[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([copy_pos], shared_buf_len);

[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
261 WARN_ON(ret); 262 } regards, dan carpenter

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

2022-04-13 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: pa

[PATCH] drm/vmwgfx: remove bogus NULL check

2022-04-12 Thread Dan Carpenter
to an 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/drm/vmwgfx

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

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
to 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
kstrdup(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
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
signing 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
les, 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
44 --- 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
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. > > T

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

2022-02-28 Thread Dan Carpenter
lated 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
name(&_phy->dev)); > BUG(); > } > } else { > - sas_port_create_link(port, phy); > - list_add_tail(>port_siblings, >phy_list); > + sas_port_create_link(port, _phy); > + list_add_tail(&_phy->port_siblings, >phy_list); > port->num_phys++; > } > mutex_unlock(>phy_list_mutex); regards, dan carpenter

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

2022-02-28 Thread Dan Carpenter
te now. Just delete it. > - if (group && >list == >tid_group_list.list) > + if (!group) > goto bail_eagain; > group = list_prepare_entry(group, >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
pped = stopped; > spin_unlock_irqrestore(>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(>dev->lock, flags); regards, dan carpenter

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

2022-02-17 Thread Dan Carpenter
if (ret) { 804ret = -EFAULT; 805goto 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
ier. 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(-)

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 STAGING th

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

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

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

2022-01-26 Thread Dan Carpenter
ed 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
ror: 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 tested. drivers/g

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

2022-01-06 Thread Dan Carpenter
return ret; 1236 } 1237 drm_connector_update_edid_property(_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

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

2021-12-17 Thread Dan Carpenter
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
t 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
deally 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
} 161 162drm_atomic_helper_shutdown(drm); 163 } regards, dan carpenter

[bug report] drm/vmwgfx: Implement DRIVER_GEM

2021-12-15 Thread Dan Carpenter
ttm_bo_put(_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 on t

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

2021-12-07 Thread Dan Carpenter
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 00:00:00 2

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'. drivers

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

2021-12-06 Thread Dan Carpenter
d 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(+), 5 d

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

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

2021-11-25 Thread Dan Carpenter
;< 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 --- drive

[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
not 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); 357 if (ret) 358 dev_dbg(dev, "

[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

[PATCH] drm/ingenic: fix error code in ingenic_drm_gem_create_object()

2021-11-18 Thread Dan Carpenter
xes: 4a791cb6d34f ("drm/ingenic: Add option to alloc cached GEM buffers") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingeni

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

2021-11-18 Thread Dan Carpenter
The ->gem_create_object() functions are supposed to return NULL if there is an error. None of the callers expect error pointers so returing one will lead to an Oops. See drm_gem_vram_create(), for example. Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.") Signed-off-by:

[PATCH] drm/nouveau/acr: fix a couple NULL vs IS_ERR() checks

2021-11-18 Thread Dan Carpenter
The nvkm_acr_lsfw_add() function never returns NULL. It returns error pointers on error. Fixes: 22dcda45a3d1 ("drm/nouveau/acr: implement new subdev to replace "secure boot"") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/nouveau/nvkm/subdev/acr/gm200.c | 6 -- dri

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

2021-11-18 Thread Dan Carpenter
The devm_gen_pool_create() function never returns NULL, it returns error pointers. Fixes: 4cc9b565454b ("drm/vboxvideo: Use devm_gen_pool_create") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/vboxvideo/vbox_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[bug report] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP

2021-11-17 Thread Dan Carpenter
n error and debugging is enabled. 1055 } else { 1056 platform->pdata.low_power_mode = 0; 1057 DRM_DEV_DEBUG_DRIVER(dev, "not low power mode.\n"); 1058 } 1059 } regards, dan carpenter

[bug report] drm/msm/dpu: merge struct dpu_irq into struct dpu_hw_intr

2021-11-16 Thread Dan Carpenter
_intr->total_irqs; i++) { --> 569 INIT_LIST_HEAD(_kms->hw_intr->irq_cb_tbl[i]); 570 atomic_set(_kms->hw_intr->irq_counts[i], 0); 571 } 572 } regards, dan carpenter

[PATCH] drm/i915/guc: fix NULL vs IS_ERR() checking

2021-11-16 Thread Dan Carpenter
The intel_engine_create_virtual() function does not return NULL. It returns error pointers. Fixes: e5e32171a2cf ("drm/i915/guc: Connect UAPI to GuC multi-lrc interface") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 4 ++-- 1 file changed, 2

[PATCH] drm/i915: Fix error pointer dereference in i915_gem_do_execbuffer()

2021-11-16 Thread Dan Carpenter
460c33821 ("drm/i915: Multi-BB execbuf") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c in

[PATCH] drm/i915: pin: delete duplicate check in intel_pin_and_fence_fb_obj()

2021-11-09 Thread Dan Carpenter
The "ret" variable is checked on the previous line so we know it's zero. No need to check again. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/display/intel_fb_pin.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i9

Re: [PATCH v11 4/4] drm/bridge: anx7625: add HDMI audio function

2021-11-03 Thread Dan Carpenter
This is a super awkward way to resend a patch series. Next time, just start a new thread and put [PATCH RESEND] in the subject. I am sorry that no one responded to your thread. :/ regards, dan carpenter

Re: [bug report] drm/msm: dsi: Handle dual-channel for 6G as well

2021-10-16 Thread Dan Carpenter
On Fri, Oct 15, 2021 at 12:34:20PM -0700, Jessica Zhang wrote: > Hey Dmitry, > > On 10/15/2021 11:24 AM, Dmitry Baryshkov wrote: > > On Fri, 15 Oct 2021 at 04:43, Jessica Zhang wrote: > > > Hey Dan, > > > > > > On 10/1/2021 5:31 AM, Da

Re: [bug report] drm/msm: dsi: Handle dual-channel for 6G as well

2021-10-15 Thread Dan Carpenter
On Thu, Oct 14, 2021 at 06:43:22PM -0700, Jessica Zhang wrote: > Hey Dan, > > On 10/1/2021 5:31 AM, Dan Carpenter wrote: > > Hello Sean Paul, > > > > The patch a6bcddbc2ee1: "drm/msm: dsi: Handle dual-channel for 6G as > > well" from Jul 25, 2018, leads

[PATCH 2/2] drm/msm: uninitialized variable in msm_gem_import()

2021-10-13 Thread Dan Carpenter
)object_init() functions. In the msm_gem_import() function the "obj" pointer is uninitialized, so it will lead to a crash. Fixes: 05b849111c07 ("drm/msm: prime support") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/msm_gem.c | 4 ++-- 1 file changed, 2 insertions(+),

[PATCH 1/2] drm/msm: fix potential NULL dereference in cleanup

2021-10-13 Thread Dan Carpenter
The "msm_obj->node" list needs to be initialized earlier so that the list_del() in msm_gem_free_object() doesn't experience a NULL pointer dereference. Fixes: 6ed0897cd800 ("drm/msm: Fix debugfs deadlock") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/msm_gem.c |

[PATCH] drm/bridge: display-connector: fix an uninitialized pointer in probe()

2021-10-13 Thread Dan Carpenter
The "label" pointer is used for debug output. The code assumes that it is either NULL or valid, but it is never set to NULL. It is either valid or uninitialized. Fixes: 0c275c30176b ("drm/bridge: Add bridge driver for display connectors") Signed-off-by: Dan Carpenter

Re: [PATCH][next] drm/i915: Fix dereference of pointer backup before it is null checked

2021-10-12 Thread Dan Carpenter
of feel like we shouldn't work around static checker bugs. But when we do then there shouldn't be a Fixes tag. regards, dan carpenter

[PATCH] drm/msm: unlock on error in get_sched_entity()

2021-10-11 Thread Dan Carpenter
Add a missing unlock on the error path if drm_sched_entity_init() fails. Fixes: 68002469e571 ("drm/msm: One sched entity per process per priority") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/msm_submitqueue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/g

[PATCH] drm/v3d: fix copy_from_user() error codes

2021-10-11 Thread Dan Carpenter
The copy_to/from_user() function returns the number of bytes remaining to be copied, but we want to return -EFAULT on error. Fixes: e4165ae8304e ("drm/v3d: add multiple syncobjs support") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/v3d/v3d_gem.c | 13 ++--- 1 file

Re: [Intel-gfx] [PATCH] drm/i915: remove IS_ACTIVE

2021-10-05 Thread Dan Carpenter
On Mon, Oct 04, 2021 at 01:52:27PM -0700, Lucas De Marchi wrote: > Cc'ing Dan Carpenter > > On Fri, Oct 01, 2021 at 12:57:13PM +0300, Jani Nikula wrote: > > On Fri, 01 Oct 2021, Chris Wilson wrote: > > > Quoting Lucas De Marchi (2021-10-01 08:40:41) > > >

Re: [PATCH] drm/msm/disp: fix endian bug in debugfs code

2021-10-05 Thread Dan Carpenter
On Tue, Oct 05, 2021 at 02:31:12AM +0300, Dmitry Baryshkov wrote: > On 04/10/2021 16:47, Dan Carpenter wrote: > > The "vbif->features" is type unsigned long but the debugfs file > > is treating it as a u32 type. This will work in little endian > > systems,

[PATCH] drm/msm: Fix potential Oops in a6xx_gmu_rpmh_init()

2021-10-04 Thread Dan Carpenter
uot;drm/msm/a6xx: Fix PDC register overlap") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index a7c58018959f..3bd

[PATCH] drm/msm/disp: fix endian bug in debugfs code

2021-10-04 Thread Dan Carpenter
The "vbif->features" is type unsigned long but the debugfs file is treating it as a u32 type. This will work in little endian systems, but the correct thing is to change the debugfs to use an unsigned long. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signe

[PATCH] drm/msm: potential error pointer dereference in init()

2021-10-04 Thread Dan Carpenter
The msm_iommu_new() returns error pointers on failure so check for that to avoid an Oops. Fixes: ccac7ce373c1 ("drm/msm: Refactor address space initialization") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 4 1 file changed, 4 insertions(+)

[PATCH] drm/i915/tc: Delete bogus NULL check in intel_ddi_encoder_destroy()

2021-10-04 Thread Dan Carpenter
The "digi_port" pointer can't be NULL and we have already dereferenced it so checking for NULL is not necessary. Delete the check. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/display/intel_ddi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drive

Re: [PATCH 3/3] drm/msm/dsi: fix signedness bug in msm_dsi_host_cmd_rx()

2021-10-04 Thread Dan Carpenter
On Sat, Oct 02, 2021 at 01:59:56AM +0300, Dmitry Baryshkov wrote: > On 01/10/2021 15:36, Dan Carpenter wrote: > > The "msg->tx_len" variable is type size_t so if dsi_cmds2buf_tx() > > returns a negative error code that it type promoted to a high positive >

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