AW: [PATCH] drm/amdgpu: fix potential integer overflow on shift of a int

2021-02-08 Thread Walter Harms
thx for info Von: Christian König Gesendet: Montag, 8. Februar 2021 13:14:49 An: Walter Harms; Colin King; Alex Deucher; David Airlie; Daniel Vetter; Huang Rui; Junwei Zhang; amd-...@lists.freedesktop.org; dri-devel@lists.freedesktop.org Cc: kernel-janit

AW: [PATCH] drm/amdgpu: fix potential integer overflow on shift of a int

2021-02-08 Thread Walter Harms
i am curious: what is the win to have a unsigned 64 bit integer in the first place ? re, wh Von: Christian König Gesendet: Montag, 8. Februar 2021 10:17:42 An: Colin King; Alex Deucher; David Airlie; Daniel Vetter; Huang Rui; Junwei Zhang; amd-...@lists.

AW: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'

2020-03-09 Thread Walter Harms
Von: kernel-janitors-ow...@vger.kernel.org im Auftrag von Christophe JAILLET Gesendet: Sonntag, 8. März 2020 10:26 An: harry.wentl...@amd.com; sunpeng...@amd.com; alexander.deuc...@amd.com; christian.koe...@amd.com; david1.z...@amd.com; airl...@linux.

AW: [PATCH][V2] backlight: sky81452: insure while loop does not allow negative array indexing

2020-02-27 Thread Walter Harms
hi all, i would suggest converting this in to a more common for() loop. Programmers are bad in counting backwards. that kind of bug is common. re, wh Von: kernel-janitors-ow...@vger.kernel.org im Auftrag von Colin King Gesendet: Mittwoch, 26. Februar

Re: [PATCH][next] drm/amd/display: fix for-loop with incorrectly sized loop counter

2020-01-17 Thread walter harms
Am 17.01.2020 14:33, schrieb Colin King: > From: Colin Ian King > > A for-loop is iterating from 0 up to 1000 however the loop variable count > is a u8 and hence not large enough. Fix this by making count an int. > Also remove the redundant initialization of count since this is never used > a

Re: [PATCH][drm-next] drm/amd/powerplay: fix a few spelling mistakes

2019-08-01 Thread walter harms
Am 01.08.2019 10:39, schrieb Colin King: > From: Colin Ian King > > There are a few spelling mistakes "unknow" -> "unknown" and > "enabeld" -> "enabled". Fix these. > > Signed-off-by: Colin Ian King > --- > drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 6 +++--- > 1 file changed, 3 insertions

Re: [PATCH][next] drm/amdgpu/psp: fix incorrect logic when checking asic_type

2019-07-04 Thread walter harms
Am 04.07.2019 16:23, schrieb Colin King: > From: Colin Ian King > > Currently the check of the asic_type is always returning true because > of the use of ||. Fix this by using && instead. Also break overly > wide line. > > Addresses-Coverity: ("Constant expression result") > Fixes: dab70ff24

Re: [PATCH 1/2] drm/bridge: sii902x: re-order conditions to prevent out of bounds read

2019-06-07 Thread walter harms
Am 07.06.2019 09:27, schrieb Dan Carpenter: > This should check that "i" is within bounds before checking reading from > the array. > > Fixes: ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support") > Signed-off-by: Dan Carpenter > --- > drivers/gpu/drm/bridge/sii902x.c | 4 ++-- >

Re: [PATCH] drm/mgag200: make array m_div_val static, shrinks object size

2018-11-30 Thread Walter Harms
Am 30.11.2018 00:40, schrieb Colin King: > From: Colin Ian King > > Don't populate the const array m_div_val on the stack but instead > make it static. Makes the object code smaller by 60 bytes: > > Before: >text data bss dec hex filename > 32339 1728 0

Re: [PATCH] drm/amd/display: indent an if statement

2017-11-04 Thread walter harms
Am 04.11.2017 07:12, schrieb Dan Carpenter: > The if statement wasn't indented so it makes static analysis tools and > probably very recent GCC versions complain. > > Signed-off-by: Dan Carpenter > --- > I went over 80 characters because other lines do already and it seemed > like the cleanest

Re: [PATCH 5/8] video: fbdev: au1200fb: Fix error handling path

2017-10-17 Thread walter harms
Am 16.10.2017 21:04, schrieb Christophe JAILLET: > Rewrite the exit path based on 'au1200fb_drv_remove()'. > We can safely iterate for all already handled planes. Even if not > completely initialized, the functions that are called will silently accept > the 'fb_info' structure that is passed. >

Re: [PATCH] drm/amdgpu: potential shift wrapping bug

2017-08-10 Thread walter harms
Am 10.08.2017 15:02, schrieb Christian König: > Am 10.08.2017 um 14:53 schrieb Dan Carpenter: >> On Thu, Aug 10, 2017 at 02:30:15PM +0200, Christian König wrote: >>> Am 10.08.2017 um 14:16 schrieb Dan Carpenter: "frag_align" is a u64, so presumably we want to use the high bits as well i

Re: [PATCH] drm/amd/powerplay: ensure loop does not wraparound on decrement

2017-05-18 Thread walter harms
Am 17.05.2017 20:13, schrieb Colin King: > From: Colin Ian King > > The current for loop decrements i when it is zero and this causes > a wrap-around back to ~0 because i is unsigned. In the unlikely event > that mask is 0, the loop will run forever. Fix this so we can't loop > forever. > > De

Re: [PATCH] drm/gma500: fix memory leak on edid

2017-03-20 Thread walter harms
Am 20.03.2017 18:56, schrieb Colin King: > From: Colin Ian King > > edid is allocated on the call to psb_intel_sdvo_get_edid but not > kfree'd at all, causing a memory leak. Fix this by kfree'ing > the edid. (This may be null, but kfree can handle null frees). > > Detected by CoverityScan, C

Re: [PATCH v2] drm/msm/dsi: Fix the releasing of resources in error path in 'dsi_bus_clk_enable()'

2017-02-26 Thread walter harms
looks good to me. Reviewed-by: wha...@bfs.de Am 26.02.2017 13:10, schrieb Christophe JAILLET: > If a 'clk_prepare_enable()' fails, then we need to disable_unprepare the > clk already handled. > > With the current implemenatation, we try to do that on the clk that has > triggered the error, which

Re: [PATCH] drm/msm/dsi: Fix the releasing of resources in error path in 'dsi_bus_clk_enable()'

2017-02-26 Thread walter harms
Am 26.02.2017 08:52, schrieb Christophe JAILLET: > If a 'clk_prepare_enable()' fails, then we need to disable_unprepare the > clk already handled. > > With the current implemenatation, we try to do that on the clk that has > triggered the error, which is a no-op, and leave 'msm_host->bus_clks[0]

Re: [patch] drm/msm/dsi: free first element on error

2017-02-16 Thread walter harms
Am 16.02.2017 12:53, schrieb Dan Carpenter: > On Thu, Feb 16, 2017 at 01:27:47PM +0200, Jani Nikula wrote: >> On Thu, 16 Feb 2017, Dan Carpenter wrote: >>> We want to free msm_host->bus_clks[0] so the > should be >=. >>> >>> Fixes: 6e0eb52eba9e ("drm/msm/dsi: Parse bus clocks from a list") >>> S

Re: [PATCH libdrm v3 2/5] xf86drm: Add USB support

2017-01-21 Thread walter harms
Am 19.01.2017 11:20, schrieb Thierry Reding: > Adding back dri-devel@lists.freedesktop.org > > On Wed, Jan 18, 2017 at 12:21:23PM +0100, walter harms wrote: >> >> >> Am 18.01.2017 10:02, schrieb Thierry Reding: >>> Allow DRM/KMS devices hosted on

[patch] drm/i915: fix a read size argument

2016-10-13 Thread walter harms
Am 13.10.2016 10:55, schrieb Dan Carpenter: > We want to read 3 bytes here, but because the parenthesis are in the > wrong place we instead read: > > sizeof(intel_dp->edp_dpcd) == sizeof(intel_dp->edp_dpcd) > > which is one byte. > > Fixes: fe5a66f91c88 ("drm/i915: Read PSR caps/intermed

[PATCH 2/4] GPU-DRM-Etnaviv: Delete unnecessary if statement in __etnaviv_gem_new()

2016-07-22 Thread walter harms
Am 22.07.2016 17:48, schrieb SF Markus Elfring: > From: Markus Elfring > Date: Fri, 22 Jul 2016 16:45:22 +0200 > > Move a return statement into a block for successful function execution. > Omit a duplicate check for the local variable "ret" then at the end. > > Signed-off-by: Markus Elfring >

[PATCH 7/8] drm/amd/powerplay: Change assignment for a buffer variable in phm_dispatch_table()

2016-07-17 Thread walter harms
Am 16.07.2016 17:08, schrieb SF Markus Elfring: > From: Markus Elfring > Date: Sat, 16 Jul 2016 15:36:36 +0200 > > The variable "temp_storage" was eventually reassigned with a pointer. > Thus omit the explicit initialisation at the beginning. > > Signed-off-by: Markus Elfring > --- > drivers

[patch] drm/amdgpu: missing bounds check in amdgpu_set_pp_force_state()

2016-06-16 Thread walter harms
Am 16.06.2016 08:41, schrieb Dan Carpenter: > There is no limit on high "idx" can go. It should be less than > ARRAY_SIZE(data.states) which is 16. > > The "data" variable wasn't declared in that scope so I shifted the code > around a bit to make it work. > > Fixes: f3898ea12fc1 ('drm/amd/powe

[patch] drm/amd: cleanup get_mfd_cell_dev()

2016-02-27 Thread walter harms
Am 27.02.2016 11:40, schrieb Dan Carpenter: > On Sat, Feb 27, 2016 at 10:50:40AM +0100, walter harms wrote: >> >> >> Am 25.02.2016 08:47, schrieb Dan Carpenter: >>> It's simpler to just use snprintf() to print this to one buffer instead >>> of using

[patch] drm/amd: cleanup get_mfd_cell_dev()

2016-02-27 Thread walter harms
Am 25.02.2016 08:47, schrieb Dan Carpenter: > It's simpler to just use snprintf() to print this to one buffer instead > of using strcpy() and strcat(). Also using snprintf() is slightly safer > than using sprintf(). > > Signed-off-by: Dan Carpenter > > diff --git a/drivers/gpu/drm/amd/amdgpu/

[patch] drm/amdgpu: potential NULL dereference on error

2015-06-11 Thread walter harms
Am 11.06.2015 14:20, schrieb Dan Carpenter: > On Thu, Jun 11, 2015 at 02:03:18PM +0200, walter harms wrote: >> >> >> Am 11.06.2015 10:49, schrieb Dan Carpenter: >>> debugfs_create_file() can return an error pointer if debugfs is disabled >>> or it can retu

[patch] drm/amdgpu: potential NULL dereference on error

2015-06-11 Thread walter harms
Am 11.06.2015 10:49, schrieb Dan Carpenter: > debugfs_create_file() can return an error pointer if debugfs is disabled > or it can return NULL on error. > > Signed-off-by: Dan Carpenter > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

[patch] drm/exynos: potential use after free in exynos_drm_open()

2014-01-21 Thread walter harms
01 } Am 21.01.2014 13:37, schrieb walter harms: > > > Am 21.01.2014 07:57, schrieb Dan Carpenter: >> If exynos_drm_subdrv_open() fails then we re-use "file_priv". >> >> Fixes: 96f5421523df ('drm/exynos: use a new anon file for exynos gem mmaper') >

[patch] drm/exynos: potential use after free in exynos_drm_open()

2014-01-21 Thread walter harms
Am 21.01.2014 07:57, schrieb Dan Carpenter: > If exynos_drm_subdrv_open() fails then we re-use "file_priv". > > Fixes: 96f5421523df ('drm/exynos: use a new anon file for exynos gem mmaper') > Signed-off-by: Dan Carpenter > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c > b/drivers/gpu

[patch] drm/nouveau/disp: add a comment on confusing loop

2013-11-20 Thread walter harms
Am 13.11.2013 08:45, schrieb Dan Carpenter: > The "ret = -EIO" is deliberate. It's a very uncommon thing to do and it > upsets static checkers because they normally would expect "ret == -EIO". > > Signed-off-by: Dan Carpenter > > diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/dport.c

[patch] drm: checking the wrong variable in savage_do_init_bci()

2012-05-17 Thread walter harms
Am 17.05.2012 09:09, schrieb Dan Carpenter: > drm_core_ioremap() initializes ->handle. We already know > "dev->agp_buffer_map" is a valid pointer. > > Signed-off-by: Dan Carpenter > > diff --git a/drivers/gpu/drm/savage/savage_bci.c > b/drivers/gpu/drm/savage/savage_bci.c > index cb1ee4e..6e

Re: [patch] drm: checking the wrong variable in savage_do_init_bci()

2012-05-17 Thread walter harms
Am 17.05.2012 09:09, schrieb Dan Carpenter: > drm_core_ioremap() initializes ->handle. We already know > "dev->agp_buffer_map" is a valid pointer. > > Signed-off-by: Dan Carpenter > > diff --git a/drivers/gpu/drm/savage/savage_bci.c > b/drivers/gpu/drm/savage/savage_bci.c > index cb1ee4e..6e