[PATCH] drm/msm/a4xx: fix error handling in a4xx_gpu_init()

2021-10-01 Thread Dan Carpenter
This code returns 1 on error instead of a negative error. It leads to an Oops in the caller. A second problem is that the check for "if (ret != -ENODATA)" cannot be true because "ret" is set to 1. Fixes: 5785dd7a8ef0 ("drm/msm: Fix duplicate gpu node in icc sum

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

2021-10-01 Thread Dan Carpenter
6ed ("drm/msm: Initial add DSI connector support") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/dsi/dsi_host.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index c86b5090fae6..42073a5620

[PATCH 2/3] drm/msm/dsi: fix off by one in dsi_bus_clk_enable error handling

2021-10-01 Thread Dan Carpenter
This disables a lock which wasn't enabled and it does not disable the first lock in the array. Fixes: 6e0eb52eba9e ("drm/msm/dsi: Parse bus clocks from a list") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 1/3] drm/msm/dsi: Fix an error code in msm_dsi_modeset_init()

2021-10-01 Thread Dan Carpenter
Return an error code if msm_dsi_manager_validate_current_config(). Don't return success. Fixes: 8b03ad30e314 ("drm/msm/dsi: Use one connector for dual DSI mode") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/dsi/dsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

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

2021-10-01 Thread Dan Carpenter
rates should be unsigned long. (I don't remember why). 730 return 0; 731 } regards, dan carpenter

[bug report] drm/msm: Add SDM845 DPU support

2021-10-01 Thread Dan Carpenter
U_DEBUG("%s created for pipe:%u id:%u virtual:%u\n", pdpu->pipe_name, 1672 pipe, plane->base.id, master_plane_id); 1673 return plane; 1674 1675 clean_sspp: 1676 if (pdpu && pdpu->pipe_hw) 1677 dpu_hw_sspp_destroy(pdpu->pipe_hw); 1678 clean_plane: --> 1679 kfree(pdpu); 1680 return ERR_PTR(ret); 1681 } regards, dan carpenter

[PATCH] drm/gma500: Fix error code in probe()

2021-09-27 Thread Dan Carpenter
The error code is stored in "dev_priv", not "dev". The "dev" pointer isn't initialized yet. Fixes: c2f17e60cbe1 ("drm/gma500: Embed struct drm_device in struct drm_psb_private") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/gma500/psb_drv.c |

[kbuild] Re: [PATCH v2 04/13] drm/hdcp: Expand HDCP helper library for enable/disable/check

2021-09-17 Thread Dan Carpenter
) 9.3.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/gpu/drm/drm_hdcp.c:1208 drm_hdcp_helper_enable_hdcp() error: uninitialized symbol 'check_link_interval'. Old smatch warnings: drivers/gpu

[PATCH] fbdev: fix printing in fb_cvt_print_name()

2021-09-16 Thread Dan Carpenter
quot; directly. Fixes: 96fe6a2109db ("[PATCH] fbdev: Add VESA Coordinated Video Timings (CVT) support") Signed-off-by: Dan Carpenter --- drivers/video/fbdev/core/fbcvt.c | 53 +--- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/drivers/video/fbd

[bug report] vmwgfx: Implement fence objects

2021-09-10 Thread Dan Carpenter
ret = vmw_fence_obj_wait(fence, arg->lazy, true, timeout); This is a new Smatch warning. To try figure out places which can trigger sysbot "task hung" warnings. I don't know if an upper bound on timeout is appropriate here because this is new experimental check... 825 826 out: 827 ttm_base_object_unref(); regards, dan carpenter

Re: [syzbot] BUG: unable to handle kernel paging request in vga16fb_fillrect

2021-08-30 Thread Dan Carpenter
On Mon, Aug 30, 2021 at 11:25:51PM +0900, Tetsuo Handa wrote: > On 2021/08/30 22:47, Dan Carpenter wrote: > > On Mon, Aug 30, 2021 at 10:37:31PM +0900, Tetsuo Handa wrote: > >> On 2021/08/30 22:00, Dan Carpenter wrote: > >>>>> diff --git a/drivers/video/fbde

Re: [syzbot] BUG: unable to handle kernel paging request in vga16fb_fillrect

2021-08-30 Thread Dan Carpenter
On Mon, Aug 30, 2021 at 10:37:31PM +0900, Tetsuo Handa wrote: > On 2021/08/30 22:00, Dan Carpenter wrote: > >>> diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c > >>> index e2757ff1c23d..e483a3f5fd47 100644 > >>> --- a/drivers/vi

Re: [syzbot] BUG: unable to handle kernel paging request in vga16fb_fillrect

2021-08-30 Thread Dan Carpenter
this code would be easier to understand if the integer overflow check were pull out separately and done first: if (array_size(vxres, vyres) >= UINT_MAX) return -EINVAL; if (vxres * vyres > maxmem) { ... The UINT_MAX is because vxres and vyres are u32. This would maybe be the first time anyone ever did an integer overflow check like this in the kernel. It's a new idiom. regards, dan carpenter

[PATCH] drm/i915/gt: Potential error pointer dereference in pinned_context()

2021-08-13 Thread Dan Carpenter
If the intel_engine_create_pinned_context() function returns an error pointer, then dereferencing "ce" will Oops. Use "vm" instead of "ce->vm". Fixes: cf586021642d ("drm/i915/gt: Pipelined page migration") Signed-off-by: Dan Carpenter --- drivers/gpu

[PATCH] drm/vmwgfx: Fix some scheduling in atomic bugs

2021-08-12 Thread Dan Carpenter
The vmw_gmrid_man_get_node() function calls vmw_host_printf() while holding a spinlock so these functions need to be atomic. Generally, no one expects printf() functions to sleep. Fixes: cfdc3458db8a ("drm/vmwgfx: Be a lot more flexible with MOB limits") Signed-off-by: Dan

Re: [syzbot] general protection fault in udmabuf_create

2021-08-10 Thread Dan Carpenter
mapping, > pgoff, > > FGP_ACCESSED); > - if (IS_ERR(hpage)) { > - ret = PTR_ERR(hpage); > + if (!hpage) { > + ret = -EINVAL; > goto err; > } > } > > I am not sure about ret value in case of failure, so I am looking for any > reviews :) You're right. Smatch is sort of supposed to warn about this but pagecache_get_page() is too complicated. regards, dan carpenter

[PATCH] drm/amdgpu: check for allocation failure in amdgpu_vkms_sw_init()

2021-08-06 Thread Dan Carpenter
Check whether the kcalloc() fails and return -ENOMEM if it does. Fixes: eeba0b9046fc ("drm/amdgpu: create amdgpu_vkms (v4)") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amd

Re: [PATCH 01/64] media: omap3isp: Extract struct group for memcpy() region

2021-07-30 Thread Dan Carpenter
ize holes. regards, dan carpenter

Re: [bug report] drm/vmwgfx: Implement an infrastructure for read-coherent resources

2021-07-29 Thread Dan Carpenter
Huh... Vmware is blocking email to Thomas? "Recipient is not authorized to accept external mail" This seems like potentially a serious bug and I don't know how to report it. regards, dan carpenter On Thu, Jul 29, 2021 at 05:39:45PM +0300, Dan Carpenter wrote: > Hello Tho

[bug report] drm/vmwgfx: Implement an infrastructure for read-coherent resources

2021-07-29 Thread Dan Carpenter
if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) 482 return ret; 483 484 out_unlock: 485 dma_resv_unlock(bo->base.resv); 486 487 return ret; 488 } regards, dan carpenter

Re: [PATCH v3 02/14] vfio/mbochs: Fix missing error unwind of mbochs_used_mbytes

2021-07-29 Thread Dan Carpenter
-1ubuntu1~20.04) 10.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: samples/vfio-mdev/mbochs.c:566 mbochs_probe() error: we previously assumed 'mdev_state' could be null (see line 524) samples/vfio-mdev

Re: [PATCH 02/64] mac80211: Use flex-array for radiotap header bitmap

2021-07-29 Thread Dan Carpenter
On Wed, Jul 28, 2021 at 04:33:18PM -0700, Kees Cook wrote: > > Ah-ha, got it: > Thanks, Kees! Nice! regards, dan carpenter

Re: [PATCH 01/64] media: omap3isp: Extract struct group for memcpy() region

2021-07-29 Thread Dan Carpenter
On Thu, Jul 29, 2021 at 07:56:27AM +0200, Greg Kroah-Hartman wrote: > On Wed, Jul 28, 2021 at 11:37:30PM +0200, David Sterba wrote: > > On Wed, Jul 28, 2021 at 02:37:20PM -0700, Bart Van Assche wrote: > > > On 7/28/21 2:14 AM, Dan Carpenter wrote: > > > > On Wed, Ju

Re: [PATCH 01/64] media: omap3isp: Extract struct group for memcpy() region

2021-07-28 Thread Dan Carpenter
lore.kernel.org/lkml/fbddb15a-6e46-3f21-23ba-b18f66e34...@suse.com/) In the kernel we don't care about portability so much. Use the = { } GCC extension. If the first member of the struct is a pointer then Sparse will complain about = { 0 }. I had a patch to make checkpatch.pl complain about = { 0 }; but my system died and I haven't transfered my postponed messages to the new system... regards, dan carpenter

Re: [PATCH 12/14] drm/kmb: Fix possible oops in error handling

2021-07-28 Thread Dan Carpenter
: Add support for KeemBay Display") > Fixes: 98521f4d4b4c ("drm/kmb: Mipi DSI part of the display driver") > Cc: Dan Carpenter > Signed-off-by: Anitha Chrisanthus > --- > drivers/gpu/drm/kmb/kmb_drv.c | 9 ++--- > drivers/gpu/drm/kmb/kmb_dsi.c | 9 +--

Re: [PATCH 02/64] mac80211: Use flex-array for radiotap header bitmap

2021-07-28 Thread Dan Carpenter
On Tue, Jul 27, 2021 at 01:57:53PM -0700, Kees Cook wrote: > In preparation for FORTIFY_SOURCE performing compile-time and run-time > field bounds checking for memcpy(), memmove(), and memset(), avoid > intentionally writing across neighboring fields. > > The it_present member of struct

Re: [PATCH v3 1/3] drm/loongson: Add DRM Driver for Loongson 7A1000 bridge chip

2021-07-23 Thread Dan Carpenter
et(dev); > + > + return 0; > + > +err: > + kfree(ldev); I'm sorry, in the earlier version I told you to add this kfree() but this is devm_ allocated so the kfree() is wrong and will lead to a double free. My bad. That's on me. > + drm_err(dev, "failed to initialize drm driver: %d\n", ret); > + return ret; > +} regards, dan carpenter

Re: [PATCH v2 1/3] drm/loongson: Add DRM Driver for Loongson 7A1000 bridge chip

2021-07-19 Thread Dan Carpenter
loongson_modeset_init(struct loongson_device *ldev) > +{ > + struct drm_encoder *encoder; > + struct drm_connector *connector; > + int i; > + u32 ret; Same. > + > + ldev->dev->mode_config.allow_fb_modifiers = true; regards, dan carpenter

Re: [PATCH v2 3/3] drm/loongson: Add interrupt driver for LS7A

2021-07-19 Thread Dan Carpenter
struct loongson_crtc *lcrtc = to_loongson_crtc(crtc); > + struct loongson_device *ldev = lcrtc->ldev; > + u32 reg_val; > + > + if (lcrtc->crtc_id) { > + reg_val = ls7a_mm_rreg(ldev, FB_INT_REG); > + reg_val |= FB_VSYNC1_ENABLE; > +

Re: [PATCH v2 1/3] drm/loongson: Add DRM Driver for Loongson 7A1000 bridge chip

2021-07-19 Thread Dan Carpenter
diff --git a/drivers/gpu/drm/loongson/loongson_plane.c > b/drivers/gpu/drm/loongson/loongson_plane.c > new file mode 100644 > index ..b8c247d1ce09 > --- /dev/null > +++ b/drivers/gpu/drm/loongson/loongson_plane.c > @@ -0,0 +1,102 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > + > +#include "loongson_drv.h" > + > +static void loongson_plane_atomic_update(struct drm_plane *plane, > + struct drm_atomic_state *state) > +{ > + struct loongson_crtc *lcrtc; > + struct loongson_device *ldev; > + struct drm_plane_state *lstate = plane->state; > + u32 gpu_addr = 0; > + u32 fb_addr = 0; > + u32 reg_val = 0; > + u32 reg_offset; > + u32 pitch; > + u8 depth; > + u32 x, y; > + > + if (!lstate->crtc || !lstate->fb) > + return; > + > + pitch = lstate->fb->pitches[0]; > + lcrtc = to_loongson_crtc(lstate->crtc); > + ldev = lcrtc->ldev; > + reg_offset = lcrtc->reg_offset; > + x = lstate->crtc->x; > + y = lstate->crtc->y; > + depth = lstate->fb->format->cpp[0] << 3; > + > + gpu_addr = loongson_gpu_offset(lstate); > + reg_val = (pitch + 255) & ~255; > + ls7a_mm_wreg(ldev, FB_STRI_REG + reg_offset, reg_val); > + > + switch (depth) { > + case 12 ... 16: > + fb_addr = gpu_addr + y * pitch + ALIGN(x, 64) * 2; > + break; > + case 24 ... 32: > + default: > + fb_addr = gpu_addr + y * pitch + ALIGN(x, 64) * 4; > + break; > + } > + > + ls7a_mm_wreg(ldev, FB_ADDR0_REG + reg_offset, fb_addr); > + ls7a_mm_wreg(ldev, FB_ADDR1_REG + reg_offset, fb_addr); > + reg_val = lcrtc->cfg_reg | CFG_ENABLE; > + ls7a_mm_wreg(ldev, FB_CFG_REG + reg_offset, reg_val); > +} > + > +static const uint32_t loongson_formats[] = { > + DRM_FORMAT_RGB565, > + DRM_FORMAT_RGB888, > + DRM_FORMAT_XRGB, > + DRM_FORMAT_ARGB, > +}; > + > +static const uint64_t loongson_format_modifiers[] = { DRM_FORMAT_MOD_LINEAR, > + DRM_FORMAT_MOD_INVALID }; > + > +static const struct drm_plane_funcs loongson_plane_funcs = { > + .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, > + .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, > + .destroy = drm_plane_cleanup, > + .disable_plane = drm_atomic_helper_disable_plane, > + .reset = drm_atomic_helper_plane_reset, > + .update_plane = drm_atomic_helper_update_plane, > +}; > + > +static const struct drm_plane_helper_funcs loongson_plane_helper_funcs = { > + .prepare_fb = drm_gem_vram_plane_helper_prepare_fb, > + .cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb, > + .atomic_update = loongson_plane_atomic_update, > +}; > + > +int loongson_plane_init(struct loongson_crtc *lcrtc) > +{ > + struct loongson_device *ldev; > + int crtc_id; > + int ret; > + > + ldev = lcrtc->ldev; > + crtc_id = lcrtc->crtc_id; > + > + lcrtc->plane = devm_kzalloc(ldev->dev->dev, sizeof(*lcrtc->plane), Why do we use ->dev->dev here and ->dev for drm_universal_plane_init()? > + GFP_KERNEL); > + if (!lcrtc->plane) > + return -ENOMEM; > + > + ret = drm_universal_plane_init(ldev->dev, lcrtc->plane, BIT(crtc_id), > +_plane_funcs, loongson_formats, > +ARRAY_SIZE(loongson_formats), > +loongson_format_modifiers, > +DRM_PLANE_TYPE_PRIMARY, NULL); > + if (ret) { > + DRM_ERROR("fail to init planed crtc %d\n", crtc_id); > + return ret; > + } > + > + drm_plane_helper_add(lcrtc->plane, _plane_helper_funcs); > + > + return 0; > +} regards, dan carpenter

Re: [PATCH v2 2/3] drm/loongson: Add GPIO and I2C driver for loongson drm.

2021-07-19 Thread Dan Carpenter
+int loongson_dc_gpio_init(struct loongson_device *ldev) > +{ > + int ret; > + struct gpio_chip *chip; struct gpio_chip *chip = >chip; int ret; > + > + chip = >chip; > + chip->label = "ls7a-dc-gpio"; > + chip->base = LS7A_DC_GPIO_BASE; &g

[PATCH 4/4] drm/amdgpu: return -EFAULT if copy_to_user() fails

2021-07-03 Thread Dan Carpenter
If copy_to_user() fails then this should return -EFAULT instead of -EINVAL. Fixes: 9b790694a031 ("drm/amdgpu: RAS EEPROM table is now in debugfs") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletion

[PATCH 3/4] drm/amdgpu: unlock on error in amdgpu_ras_debugfs_table_read()

2021-07-03 Thread Dan Carpenter
This error path needs to unlock before returning. While we're at it, the correct error code from copy_to_user() failure is -EFAULT, not -EINVAL. Fixes: 9b790694a031 (""drm/amdgpu: RAS EEPROM table is now in debugfs) Signed-off-by: Dan Carpenter --- drivers/gpu/drm/

[PATCH 2/4] drm/amdgpu: Fix signedness bug in __amdgpu_eeprom_xfer()

2021-07-03 Thread Dan Carpenter
y changing the < to != which works regardless of type promotion. Fixes: 6cda0af81a50 ("drm/amdgpu: Fixes to the AMDGPU EEPROM driver") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dri

[PATCH 1/4] drm/amdgpu: fix a signedness bug in __verify_ras_table_checksum()

2021-07-03 Thread Dan Carpenter
of "buf_size" to int. Fixes: 79beb6114014 ("drm/amdgpu: Optimize EEPROM RAS table I/O") Signed-off-by: Dan Carpenter --- It's hard for me to tell the exact upper bound that "buf_size" can be, but if it's over USHRT_MAX then we are well toasted. drivers/gpu/drm/amd

Re: [Intel-gfx] [drm-intel:drm-intel-gt-next 8/14] drivers/gpu/drm/i915/gt/selftest_migrate.c:102 copy() error: uninitialized symbol 'rq'.

2021-07-02 Thread Dan Carpenter
which involves dropping some locks), if we see any other > error then the loop is terminated with ww->loop = false, which then > hits the goto err_out. > Ah, yeah, you're right. False positive. I hadn't looked at this code in context (I only had reviewed the email). Now that I've pulled the tree and looked at the code, then I'm sort of surprised that Smatch generates a warning... I will investigate some more. Thanks! regards, dan carpenter

Re: [Intel-gfx] [drm-intel:drm-intel-gt-next 8/14] drivers/gpu/drm/i915/gt/selftest_migrate.c:102 copy() error: uninitialized symbol 'rq'.

2021-07-02 Thread Dan Carpenter
On Fri, Jul 02, 2021 at 02:07:27PM +0300, Dan Carpenter wrote: > On Fri, Jul 02, 2021 at 11:32:45AM +0100, Matthew Auld wrote: > > On Fri, 2 Jul 2021 at 09:45, Dan Carpenter wrote: > > > cf586021642d80 Chris Wilson 2021-06-17 84 > > > cf586021642d80 Chris Wilson 2021

Re: [Intel-gfx] [drm-intel:drm-intel-gt-next 8/14] drivers/gpu/drm/i915/gt/selftest_migrate.c:102 copy() error: uninitialized symbol 'rq'.

2021-07-02 Thread Dan Carpenter
On Fri, Jul 02, 2021 at 11:32:45AM +0100, Matthew Auld wrote: > On Fri, 2 Jul 2021 at 09:45, Dan Carpenter wrote: > > > > tree: git://anongit.freedesktop.org/drm-intel drm-intel-gt-next > > head: 5cd57f676bb946a00275408f0dd0d75dbc466d25 > > commit: cf586021642d8017

[drm-intel:drm-intel-gt-next 7/8] drivers/gpu/drm/i915/selftests/intel_memory_region.c:227 igt_mock_reserve() error: 'mem' dereferencing possible ERR_PTR()

2021-07-02 Thread Dan Carpenter
(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 New smatch warnings: drivers/gpu/drm/i915/selftests/intel_memory_region.c:227 igt_mock_reserve() error: 'mem' dereferencing possible ERR_PTR() vim +/mem

[drm-intel:drm-intel-gt-next 8/14] drivers/gpu/drm/i915/gt/selftest_migrate.c:102 copy() error: uninitialized symbol 'rq'.

2021-07-02 Thread Dan Carpenter
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 New smatch warnings: drivers/gpu/drm/i915/gt/selftest_migrate.c:102 copy() error: uninitialized symbol 'rq'. drivers/gpu/drm/i915/gt/selftest_migrate.c:113 copy

Re: [PATCH] dma-buf: fix and rework dma_buf_poll v3

2021-06-23 Thread Dan Carpenter
ebian 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/dma-buf/dma-buf.c:290 dma_buf_poll() error: uninitialized symbol 'fence_excl'. vim +/fence_excl +290 drivers/dma-buf/dma-

Re: [PATCH] drm/gma500/oaktrail_lvds: replace continue with break

2021-06-19 Thread Dan Carpenter
->crtc == crtc) > + break; > } > > if (!connector) { This test is wrong/impossible. It should be: if (list_entry_is_head(connector, _config->connector_list, head)) { regards, dan carpenter

[PATCH] drm/amdgpu: fix amdgpu_preempt_mgr_new()

2021-06-18 Thread Dan Carpenter
There is a reversed if statement in amdgpu_preempt_mgr_new() so it always returns -ENOMEM. Fixes: 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_pre

Re: [PATCH] drm/nouveau/core/object: fix double free on error in nvkm_ioctl_new()

2021-06-17 Thread Dan Carpenter
On Mon, Jun 14, 2021 at 01:43:27PM +0300, Dan Carpenter wrote: > If nvkm_object_init() fails then we should not call nvkm_object_fini() > because it results in calling object->func->fini(object, suspend) twice. > Once inside the nvkm_object_init() function and once inside the >

Re: [PATCH] drm/ttm: fix error handling in ttm_bo_handle_move_mem()

2021-06-16 Thread Dan Carpenter
On Wed, Jun 16, 2021 at 01:00:38PM +0200, Christian König wrote: > > > Am 16.06.21 um 11:36 schrieb Dan Carpenter: > > On Wed, Jun 16, 2021 at 10:47:14AM +0200, Christian König wrote: > > > > > > Am 16.06.21 um 10:37 schrieb Dan Carpenter: > > >

Re: [PATCH] drm/ttm: fix error handling in ttm_bo_handle_move_mem()

2021-06-16 Thread Dan Carpenter
On Wed, Jun 16, 2021 at 10:47:14AM +0200, Christian König wrote: > > > Am 16.06.21 um 10:37 schrieb Dan Carpenter: > > On Wed, Jun 16, 2021 at 08:46:33AM +0200, Christian König wrote: > > > Sending the first message didn't worked, so let's try again. > > > >

Re: [PATCH] drm/ttm: fix error handling in ttm_bo_handle_move_mem()

2021-06-16 Thread Dan Carpenter
On Wed, Jun 16, 2021 at 08:46:33AM +0200, Christian König wrote: > Sending the first message didn't worked, so let's try again. > > Am 16.06.21 um 08:30 schrieb Dan Carpenter: > > There are three bugs here: > > 1) We need to call unpopulate() if ttm_tt_populate() succeeds

[PATCH] drm/ttm: fix error handling in ttm_bo_handle_move_mem()

2021-06-16 Thread Dan Carpenter
yway as we already have the value for "new_mem". 3) The (!new_man->use_tt) condition is reversed. Fixes: ba4e7d973dd0 ("drm: Add the TTM GPU memory manager subsystem.") Signed-off-by: Dan Carpenter --- This is from reading the code and I can't swear that I have understood

[PATCH] drm/nouveau: fix double free in nouveau_gem_new()

2021-06-15 Thread Dan Carpenter
The ttm_bo_init_reserved() function calls ttm_bo_put(bo) which calls nouveau_bo_del_ttm() which frees the "nvbo.bo" so the nouveau_bo_ref() call leads to a double free. Fixes: 019cbd4a4feb ("drm/nouveau: Initialize GEM object before TTM object") Signed-off-by: Dan Car

Re: [PATCH] drm/nouveau/core/object: fix double free on error in nvkm_ioctl_new()

2021-06-14 Thread Dan Carpenter
On Mon, Jun 14, 2021 at 01:43:27PM +0300, Dan Carpenter wrote: > If nvkm_object_init() fails then we should not call nvkm_object_fini() > because it results in calling object->func->fini(object, suspend) twice. > Once inside the nvkm_object_init() function and once inside the >

[PATCH] drm/nouveau/core/object: fix double free on error in nvkm_ioctl_new()

2021-06-14 Thread Dan Carpenter
with handle") Signed-off-by: Dan Carpenter --- This is something that I spotted while looking for reference counting bugs. I have tried running it, but it does not fix my crashes. My system is basically unusable. It's something to do with the new version of Firefox which triggers the refc

question about error handling in ttm_bo_handle_move_mem()

2021-06-10 Thread Dan Carpenter
ortunately, making these changes doesn't fix my crashes and I'm still investigating. 274 ttm_bo_tt_destroy(bo); 275 276 return ret; 277 } regards, dan carpenter [ 159.893081] nouveau :01:00.0: Direct firmware load for nouveau/nva8_fuc084 failed with error

[PATCH 2/2] drm/amdgpu: Fix an error code in kfd_mem_attach_dmabuf()

2021-05-25 Thread Dan Carpenter
If amdgpu_gem_prime_export() fails, then this code accidentally returns zero/success instead of a negative error code. Fixes: 190f2d7696c8 ("drm/amdgpu: Add DMA mapping of GTT BOs") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 +++- 1 file

[PATCH 1/2] drm/amdgpu: add missing unreserve on error

2021-05-25 Thread Dan Carpenter
The amdgpu_bo_unreserve() has to be done on the error path as well. Fixes: b4f0f97b8f5f ("drm/amdgpu: Move kfd_mem_attach outside reservation") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

[PATCH] drm/bridge: ti-sn65dsi86: fix a ternary type promotion bug

2021-05-18 Thread Dan Carpenter
679 ("drm/bridge: ti-sn65dsi86: If refclk, DP AUX can happen w/out pre-enable") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/

[PATCH] hgafb: fix probe function

2021-05-17 Thread Dan Carpenter
There is a reversed if statement in this probe function so the driver is completely broken. Fixes: dc13cac4862c ("video: hgafb: fix potential NULL pointer dereference") Signed-off-by: Dan Carpenter --- drivers/video/fbdev/hgafb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH] drm: simpledrm: fix a potential NULL dereference

2021-05-15 Thread Dan Carpenter
). Fixes: 11e8f5fd223b ("drm: Add simpledrm driver") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/tiny/simpledrm.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index f72ca3a1c2d4..4f

[PATCH 2/2] drm: bridge: it66121: fix a resource leak in probe

2021-05-15 Thread Dan Carpenter
it66121 driver") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/bridge/ite-it66121.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c index 6980c9801d0d..7149ed40af83 100644 --- a/driver

[PATCH 1/2] drm: bridge: it66121: fix an error code in it66121_probe()

2021-05-15 Thread Dan Carpenter
This code is passing the wrong variable to PTR_ERR() so it doesn't return the correct error code. Fixes: 988156dc2fc9 ("drm: bridge: add it66121 driver") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/bridge/ite-it66121.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [bug report] drm: remove usage of drm_pci_alloc/free

2021-05-15 Thread Dan Carpenter
On Fri, May 14, 2021 at 09:34:27AM -0700, Joseph Kogut wrote: > On Fri, May 14, 2021 at 8:13 AM Joseph Kogut wrote: > > > > Hi Dan, > > > > On Fri, May 14, 2021 at 6:54 AM Dan Carpenter > > wrote: > > > > > > Hello Joseph Kogut, >

Re: [PATCH][next] drm/vmwgfx: Fix memory leak of object fifo on error return

2021-05-14 Thread Dan Carpenter
>static_buffer == NULL)) > + if (unlikely(fifo->static_buffer == NULL)) { > + kfree(fifo); > return ERR_PTR(-ENOMEM); > + } regards, dan carpenter

[bug report] drm: remove usage of drm_pci_alloc/free

2021-05-14 Thread Dan Carpenter
1007 entry->seglist[entry->seg_count++] = dmah; 1008 for (i = 0; i < (1 << page_order); i++) { 1009 DRM_DEBUG("page %d @ 0x%08lx\n", regards, dan carpenter

Re: [PATCH v3 3/4] staging: fbtft: Don't spam logs when probe is deferred

2021-04-29 Thread Dan Carpenter
On Thu, Apr 29, 2021 at 05:42:44PM +0300, Dan Carpenter wrote: > On Wed, Apr 28, 2021 at 04:04:14PM +0300, Andy Shevchenko wrote: > > @@ -75,20 +75,16 @@ static int fbtft_request_one_gpio(struct fbtft_par *par, > > struct gpio_desc **gpiop) > &

Re: [PATCH v3 3/4] staging: fbtft: Don't spam logs when probe is deferred

2021-04-29 Thread Dan Carpenter
turn dev_err_probe(dev, PTR_ERR(*gpiop), "Failed to request %s GPIO\n", name); > + > fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' GPIO\n", > __func__, name); > > - return ret; > + return 0; > } regards, dan carpenter __

[PATCH] drm/vc4: fix argument ordering in vc4_crtc_get_margins()

2021-04-21 Thread Dan Carpenter
y: kernel test robot Signed-off-by: Dan Carpenter --- drivers/gpu/drm/vc4/vc4_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index a7500716cf3f..5dceadc61600 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b

Re: [RFC v1 PATCH 1/3] drivers: soc: add support for soc_device_match returning -EPROBE_DEFER

2021-04-20 Thread Dan Carpenter
tr_init_done = true; > > return soc_dev; > > > > out3: > > @@ -246,6 +248,9 @@ const struct soc_device_attribute *soc_device_match( > > if (!matches) > > return NULL; > > > > + if (!soc_dev_attr_init_done && !early_s

[PATCH] drm/i915: fix an error code in intel_overlay_do_put_image()

2021-04-14 Thread Dan Carpenter
This code should propagate the error from intel_overlay_pin_fb() but currently it returns success. Fixes: 1b321026e213 ("drm/i915: Pass ww ctx to intel_pin_to_display_plane") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/display/intel_overlay.c | 4 +++- 1 file changed, 3

[PATCH] drm/i915/gvt: Fix error code in intel_gvt_init_device()

2021-04-14 Thread Dan Carpenter
and make everything consistent. Fixes: c5d71cb31723 ("drm/i915/gvt: Move vGPU type related code into gvt file") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gvt/gvt.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/d

[PATCH v2] drm/amdgpu: fix an error code in init_pmu_entry_by_type_and_add()

2021-04-13 Thread Dan Carpenter
If the kmemdup() fails then this should return a negative error code but it currently returns success Fixes: b4a7db71ea06 ("drm/amdgpu: add per device user friendly xgmi events for vega20") Signed-off-by: Dan Carpenter --- v2: I sent this patch in Feb but I accidentally added an unre

[PATCH] drm/nouveau: fix an error code in nouveau_backlight_init()

2021-04-13 Thread Dan Carpenter
If nouveau_get_backlight_name() fails then this should return -ENOMEM but currently it returns success. Fixes: db1a0ae21461 ("drm/nouveau/bl: Assign different names to interfaces") Signed-off-by: Dan Carpenter --- This is from static analysis. In the original commit db1a0ae21461 (&q

[drm-intel:drm-intel-next 3/4] drivers/gpu/drm/i915/display/intel_dp_hdcp.c:582 intel_dp_hdcp2_read_msg() error: uninitialized symbol 'msg_end'.

2021-04-02 Thread Dan Carpenter
-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/i915/display/intel_dp_hdcp.c:582 intel_dp_hdcp2_read_msg() error: uninitialized symbol 'msg_end'. vim +/msg_end

Re: [PATCH] fix NULL pointer deference crash

2021-03-31 Thread Dan Carpenter
as .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 New smatch warnings: drivers/video/fbdev/core/fbcon.c:1336 fbcon_cursor() warn: variable dereferenced before check 'ops' (see

Re: [PATCH v5 1/1] drm/bridge: lt8912b: fix incorrect handling of of_* return values

2021-03-31 Thread Dan Carpenter
On Wed, Mar 31, 2021 at 03:33:13PM +0200, Adrien Grassein wrote: > A static analysis shows several issues in the driver code at > probing time. > > DT parsing errors were bad handled and could lead to bugs: > - Bad error detection; > - Bad release of ressources > > Re

Re: [PATCH v4 1/1] drm/bridge: lt8912b: Fix issues found during static analysis

2021-03-31 Thread Dan Carpenter
of_node_put(lt->host_node); But, yeah, putting the of_node_put() after the label isn't bug so whatever... regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v4 1/1] drm/bridge: lt8912b: Fix issues found during static analysis

2021-03-31 Thread Dan Carpenter
Thanks! regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v3 1/1] drm/bridge: lt8912b: Fix issues found during static analysis

2021-03-31 Thread Dan Carpenter
int); > + if (data_lanes < 0) { > + dev_err(lt->dev, "%s: Bad data-lanes property\n", __func__); > + return lt->data_lanes; This needs to be "return data_lanes;" > + } > + lt->data_lanes = data_lanes; I really be

Re: [PATCH v2 1/1] drm/bridge: lt8912b: Fix issues found during static analysis

2021-03-31 Thread Dan Carpenter
port\n", __func__); > + of_node_put(port_node); > ret = -EINVAL; > + goto err_free_host_node; > } > > of_node_put(port_node); Also, btw the success path does "return ret;" but it would be nicer to "return 0;". regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v1 1/1] drm/bridge: lt8912b: Fix issues found during static analysis

2021-03-31 Thread Dan Carpenter
On Wed, Mar 31, 2021 at 11:38:22AM +0200, Adrien Grassein wrote: > Some issues where found during static analysis of this driver. > > Reported-by: Dan Carpenter > Suggested-by: Dan Carpenter > Signed-off-by: Adrien Grassein > --- > drivers/gpu/drm/bridge/l

Re: [bug report] drm/bridge: Introduce LT8912B DSI to HDMI bridge

2021-03-31 Thread Dan Carpenter
e could you use Reported-by? regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [bug report] drm/bridge: Introduce LT8912B DSI to HDMI bridge

2021-03-31 Thread Dan Carpenter
On Wed, Mar 31, 2021 at 11:12:38AM +0300, Dan Carpenter wrote: >644 of_node_put(endpoint); >645 >646 lt->host_node = of_graph_get_remote_node(dev->of_node, 0, -1); >647 if (!lt->host_node) { >648 dev_err(lt-

[bug report] drm/bridge: Introduce LT8912B DSI to HDMI bridge

2021-03-31 Thread Dan Carpenter
rt_node); 674 675 end: 676 return ret; 677 678 err_free_host_node: 679 of_node_put(lt->host_node); 680 return ret; 681 } regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm: xlnx: zynqmp: fix a memset in zynqmp_dp_train()

2021-03-30 Thread Dan Carpenter
The dp->train_set[] for this driver is only two characters, not four so this memsets too much. Fortunately, this ends up corrupting a struct hole and not anything important. Fixes: d76271d22694 ("drm: xlnx: DRM/KMS driver for Xilinx ZynqMP DisplayPort Subsystem") Signed-off-by:

[bug report] drm/amd/display: Reuse parsing code of debugfs write buffer

2021-03-29 Thread Dan Carpenter
p++; sub_str = strsep(, delimiter); ret = kstrtol(sub_str, 16, &(param[param_index])); if (ret) goto done; (*param_nums)++; } done: kfree(wr_buf); return 0; regards, dan carpenter

[bug report] drm/ttm: switch to per device LRU lock

2021-03-26 Thread Dan Carpenter
busy_bo = NULL; 665 spin_unlock(>bdev->lru_lock); ^^ Dereference 666 ret = ttm_mem_evict_wait_busy(busy_bo, ctx, ticket); 667 if (busy_bo) regards, dan carpenter

Re: [PATCH] drm/msm/dp: Fix warnings reported by kbot in DP driver

2021-03-04 Thread Dan Carpenter
l check if the root is an error pointer. So passing it "handles" errors itself. The one time where I've seen that checking for errors is essential is if they driver dereferences the "test_data" dentry itself. That's pretty uncommon. [ So probably the commit message for this chunk

[PATCH] drm/amd/display: Fix off by one in hdmi_14_process_transaction()

2021-03-02 Thread Dan Carpenter
of these arrays as having HDCP_MESSAGE_ID_MAX entries. This doesn't change the code, but it's just a belt and suspenders approach to try future proof the code. Fixes: 4c283fdac08a ("drm/amd/display: Add HDCP module") Signed-off-by: Dan Carpenter --- >From static analysis, as mentioned

[PATCH RESEND] drm/vc4: Fix an error code vc4_create_object()

2021-02-25 Thread Dan Carpenter
cache.") Signed-off-by: Dan Carpenter --- I sent this patch last June but it was never applied. drivers/gpu/drm/vc4/vc4_bo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 72d30d90b856c..0af246a5609ca 100644 ---

Re: [PATCH 2/3] drm/ttm: remove swap LRU

2021-02-11 Thread Dan Carpenter
u fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/gpu/drm/ttm/ttm_device.c:144 ttm_device_swapout() warn: variable dereferenced before check 'bo->ttm' (see line 142) vim +144 drivers/gpu

[PATCH] drm/virtio: fix an error code in virtio_gpu_init()

2021-02-03 Thread Dan Carpenter
If devm_request_mem_region() fails this code currently returns success but it should return -EBUSY. Fixes: 6076a9711dc5 ("drm/virtio: implement blob resources: probe for host visible region") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/virtio/virtgpu_kms.c | 1 + 1 file

Re: [PATCH v12] staging: fbtft: add tearing signal detect

2021-01-28 Thread Dan Carpenter
Ditto for > PTR_ERR(). Have you even looked for these macros implementations? > Yeah... It leads to a compile warning: warning: passing argument 1 of ‘IS_ERR’ makes pointer from integer without a cast [-Wint-conversion] regards, dan carpenter __

Re: [PATCH v10] staging: fbtft: add tearing signal detect

2021-01-28 Thread Dan Carpenter
er should fix the error or disable the feature if they want to continue. There are lots of places in the kernel where the error handling could be written to try continue but in a crippled state. It's not the right approach. Over engineering like that just leads to bugs. regards, dan carpente

Re: [PATCH v10] staging: fbtft: add tearing signal detect

2021-01-27 Thread Dan Carpenter
ere that is missing the fact that > a line is being indented with spaces and not tabs in the patch > at > https://lore.kernel.org/r/1611754972-151016-1-git-send-email-zhangxuez...@gmail.com > > Any ideas what broke? > /*Tearing Effect Line On*/ Comments are the exception to the "no spaces at the start of a line" rule. I was expecting that the kbuild-bot would send a Smatch warning for inconsistent indenting, but comments are not counted there either. I'm sort of surprised that we don't have checkpatch rule about the missing space characters. It should be: "/* Tearing Effect Line On */". regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v6] fbtft: add tearing signal detect

2021-01-27 Thread Dan Carpenter
gpiod_to_irq(par->gpio.te)); > + pr_info("TE request_irq completion.\n"); #SadFaceEmoji > + } > + } else { > + pr_info("%s:%d, TE gpio not specified\n", > + __func__, __LINE__); > + } regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v5] fbtft: add tearing signal detect

2021-01-26 Thread Dan Carpenter
("Failed to request te gpio: %d\n", rc); > par->gpio.te = NULL; > } I wish you would just copy and paste the code that I sent you instead, but this also fixes the crash... regards, dan carpenter ___ dri-dev

Re: [PATCH v5] fbtft: add tearing signal detect

2021-01-26 Thread Dan Carpenter
on the success path. You should add that to your code while your debugging the feature, but don't push it to the upstream kernel. > + } > + } else { > + pr_info("%s:%d, TE gpio not specified\n", > + __func__, __

Re: [PATCH v5] fbtft: add tearing signal detect

2021-01-26 Thread Dan Carpenter
the error code. Write it exactly like this: par->gpio.te = devm_gpiod_get_index_optional(dev, "te", 0, GPIOD_IN); if (IS_ERR(par->gpio.te)) return PTR_ERR(par->gpio.te); if (par->gpio.te) { init_completion(_panel_te); regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v4] fbtft: add tearing signal detect

2021-01-26 Thread Dan Carpenter
par->gpio.te = NULL; > + } else { > + disable_irq_nosync(gpiod_to_irq(par->gpio.te)); > + pr_info("TE request_irq completion.\n"); > + } > + } else { > + pr_err("%s:%d, TE gpio not specif

Re: [PATCH v2] fbtft: add tearing signal detect

2021-01-26 Thread Dan Carpenter
On Mon, Jan 25, 2021 at 04:44:12PM +0800, Carlis wrote: > From: "carlis.zhang_cp" I was really expecting that you would fix this and Signed-off-by as well. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesk

Re: [PATCH] fbtft: add tearing signal detect

2021-01-25 Thread Dan Carpenter
e); > + rc = wait_for_completion_timeout(_panel_te, > + > msecs_to_jiffies(SPI_PANEL_TE_TIMEOUT)); > + if (rc == 0) > + pr_err("wait panel TE time out\n&qu

Re: [PATCH] drm/vmwgfx/vmwgfx_drv: Fix an error path in vmw_setup_pci_resources()

2021-01-25 Thread Dan Carpenter
On Mon, Jan 25, 2021 at 07:13:43PM +, Zack Rusin wrote: > > > > On Jan 25, 2021, at 03:45, Dan Carpenter wrote: > > > > The devm_memremap() function never returns NULL, it returns error > > pointers so the test needs to be fixed. Also we need to call >

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