[PATCH][next] drm/i915: remove redundant checks for a null fb pointer

2019-12-10 Thread Colin King
From: Colin Ian King A prior check and return when pointer fb is null makes subsequent null checks on fb redundant. Remove the redundant null checks. Addresses-Coverity: ("Logically dead code") Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/i915_debugfs.c | 4 ++-- 1 file changed, 2 i

[PATCH][next] drm/i915/display: remove duplicated assignment to pointer crtc_state

2019-12-10 Thread Colin King
From: Colin Ian King Pointer crtc_state is being assigned twice, one of these is redundant and can be removed. Addresses-Coverity: ("Evaluation order violation") Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/display/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH] drm/amdgpu/powerplay: remove redundant assignment to variable baco_state

2019-08-22 Thread Colin King
From: Colin Ian King Variable baco_state is initialized to a value that is never read and it is re-assigned later. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused Value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 2 +- 1 file

[PATCH][drm-next] drm/amdgpu: fix spelling mistake "jumpimng" -> "jumping"

2019-08-28 Thread Colin King
From: Colin Ian King There is a spelling mistake in a DRM_DEBUG_DRIVER debug message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c b/d

[PATCH] staging: fbtft: make several arrays static const, makes object smaller

2019-09-06 Thread Colin King
From: Colin Ian King Don't populate the arrays on the stack but instead make them static const. Makes the object code smaller by 1329 bytes. Before: textdata bss dec hex filename 55811488 6471331bdd drivers/staging/fbtft/fb_hx8340bn.o 54441264

[PATCH] fbdev: matrox: make array wtst_xlat static const, makes object smaller

2019-09-06 Thread Colin King
From: Colin Ian King Don't populate the array wtst_xlat on the stack but instead make it static const. Makes the object code smaller by 89 bytes. Before: textdata bss dec hex filename 14347 840 0 151873b53 fbdev/matrox/matroxfb_misc.o After: textdata

[PATCH] drm/selftests: fix spelling mistake "misssing" -> "missing"

2019-09-11 Thread Colin King
From: Colin Ian King There is a spelling mistake in a literal string, fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/selftests/test-drm_framebuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/selftests/test-drm_framebuffer.c b/drivers/gpu/d

[PATCH] drm/i915/gvt: fix spelling mistake "resseting" -> "resetting"

2019-09-11 Thread Colin King
From: Colin Ian King There is a spelling mistake in a gvt_dbg_core debug message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gvt/vgpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/vgpu.c b/drivers/gpu/drm/i915/gvt/vgpu.c inde

[PATCH][drm-next] drm/amd/powerplay: remove redundant duplicated return check

2019-08-05 Thread Colin King
From: Colin Ian King The check on ret is duplicated in two places, it is redundant code. Remove it. Addresses-Coverity: ("Logically dead code") Fixes: b94afb61cdae ("drm/amd/powerplay: honor hw limit on fetching metrics data for navi10") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/p

[PATCH] drm/amdgpu/powerplay: fix spelling mistake "unsuported" -> "unsupported"

2019-08-13 Thread Colin King
From: Colin Ian King There is a spelling mistake in a pr_err error message. Fix it. Also add a space after a comma to clean up a checkpatch warning. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d

[PATCH][drm-next] drm/amd/display: fix a potential null pointer dereference

2019-08-16 Thread Colin King
From: Colin Ian King Currently the pointer init_data is dereferenced on the assignment of fw_info before init_data is sanity checked to see if it is null. Fix te potential null pointer dereference on init_data by only performing dereference after it is null checked. Addresses-Coverity: ("Derefer

[PATCH][drm-next] drm/panel: remove redundant assignment to val

2019-08-17 Thread Colin King
From: Colin Ian King Variable val is initialized to a value in a for-loop that is never read and hence it is redundant. Remove it. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/panel/panel-tpo-td043mtea1.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH][next] nouveau/svm: Fix missing failure check on call to make_device_exclusive_range

2021-05-26 Thread Colin King
From: Colin Ian King The call to make_device_exclusive_range can potentially fail leaving pointer page not initialized that leads to an uninitialized pointer read issue. Fix this by adding a check to see if the call failed and returning the error code. Addresses-Coverity: ("Uninitialized pointer

[PATCH] drm/amdgpu: remove redundant assignment of variable k

2021-06-03 Thread Colin King
From: Colin Ian King The variable k is being assigned a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH] drm/amd/display: remove variable active_disp

2021-06-03 Thread Colin King
From: Colin Ian King The variable active_disp is being initialized with a value that is never read, it is being re-assigned immediately afterwards. Clean up the code by removing the need for variable active_disp. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gp

[PATCH][next] drm/amd/display: Fix two spelling mistakes, clean wide lines

2021-06-07 Thread Colin King
From: Colin Ian King There are two spelling mistakes in dml_print messages, fix these and clear up checkpatch warning on overly wide line length. Signed-off-by: Colin Ian King --- .../drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletio

[PATCH] drm: qxl: ensure surf.data is ininitialized

2021-06-08 Thread Colin King
From: Colin Ian King The object surf is not fully initialized and the uninitialized field surf.data is being copied by the call to qxl_bo_create via the call to qxl_gem_object_create. Set surf.data to zero to ensure garbage data from the stack is not being copied. Addresses-Coverity: ("Uninitial

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

2021-06-18 Thread Colin King
From: Colin Ian King Currently a loop scans through the connector list checking for connectors that do not match a specific criteria. The use of the continue statement is a little unintuitive and can confuse static analysis checking. Invert the criteria matching logic and use a break to terminat

[PATCH] drm/amd/amdgpu: default to zero number of states if not enabled

2016-10-06 Thread Colin King
From: Colin Ian King Currently, if adev->pp_enabled is false then the pp_stats_info data is not read and hence a garbage number of states from the stack is used to dump out the number of states. Given data.nums could be any random value, this could easily lead to read outside the data.states arra

[PATCH] drm/amdgpu/virt: fix spelling mistake: "hypervior" -> "hypervisor"

2017-03-30 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in DRM_ERROR error message Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_

[PATCH] drm/mediatek: re-phrase DRM_INFO error message

2017-04-11 Thread Colin King
From: Colin Ian King The current message contains a spelling mistake and is not easily parsable. Re-phrase it to be more understandable. Signed-off-by: Colin Ian King --- drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/medi

[PATCH] drm: fix spelling mistake: "committing"

2017-04-12 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in DRM_DEBUG_ATOMIC debug message Signed-off-by: Colin Ian King --- drivers/gpu/drm/drm_atomic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index f32506

[PATCH] drm/i915/gvt: fix typo: "supporte" -> "support"

2017-04-25 Thread Colin King
From: Colin Ian King trivial fix to typo in WARN_ONCE message Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gvt/handlers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c index 0ad1a508e2af.

[PATCH] drm/amd/powerplay: header should be defining _SMU7_CLOCK_POWER_GATING_H_

2017-01-25 Thread Colin King
From: Colin Ian King _SMU7_CLOCK_POWER_GATING_H_ is being used as a header guard, followed by a #define of a different macro. Define _SMU7_CLOCK_POWER_GATING_H_ instead to fix this. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.h | 2 +- 1 file ch

[PATCH] drm/vc4: simplify exit path of a failed allocation of dsi_connector

2017-02-03 Thread Colin King
From: Colin Ian King If dsi_connector fails to allocate, the exit path via label 'fail' checks if connector is null, which it always is, so the cleanup that destroys connector is never going to be called. Hence the failure path can be more optimally performed by removing this and just returning

[PATCH] drm/amdgpu/virt: fix double kfree on bo_va

2017-02-03 Thread Colin King
From: Colin Ian King bo_va is being kfree'd twice, once in the call to amdgpu_vm_bo_rmv and then a short while later. Fix this double free by removing the 2nd kfree. Detected by CoverityScan, CID#1399524 ("Double Free") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.

[PATCH] drm: kselftest: fix spelling mistake: "misalinged" -> "misaligned"

2017-02-22 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in pr_err message Signed-off-by: Colin Ian King --- drivers/gpu/drm/selftests/test-drm_mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/selftests/test-drm_mm.c b/drivers/gpu/drm/selftests/test-drm_mm.

[PATCH] drm/exynos: gsc: fix spelling mistakes

2016-11-01 Thread Colin King
From: Colin Ian King Trivial fixes to spelling mistakes "precalser" to "prescaler" in dev_err messages Signed-off-by: Colin Ian King --- drivers/gpu/drm/exynos/exynos_drm_fimc.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --gi

[PATCH] drm/atomic: fix memory leak when fetching format name

2016-11-11 Thread Colin King
From: Colin Ian King drm_get_format_name allocates memory that is not currently free'd when printing the state. Fix this by kfree'ing the memory after use. Signed-off-by: Colin Ian King --- drivers/gpu/drm/drm_atomic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dr

[PATCH] amdkfd: fix spelling mistake in kfd_ioctl_dbg_unrgesiter

2016-11-12 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake, rename kfd_ioctl_dbg_unrgesiter to kfd_ioctl_dbg_unregister Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_

[PATCH] drm/i2c/tda998x: fix spelling mistake

2016-11-14 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake "configutation" to "configuration" in dev_err message Signed-off-by: Colin Ian King --- drivers/gpu/drm/i2c/tda998x_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/dr

[PATCH] drm/amd/powerplay: check if table_info is NULL before dereferencing it

2016-11-15 Thread Colin King
From: Colin Ian King table_info is being dereferenced before a null check, which implies a potential null pointer deference error. Fix this by moving the null check of table_info to the start of smu7_get_evv_voltages to avoid potential null pointer deferencing. Found with static analysis by Cov

[PATCH][drm-next] drm/i915/cnl: make function cnl_ddi_dp_set_dpll_hw_state static

2017-06-13 Thread Colin King
From: Colin Ian King The function cnl_ddi_dp_set_dpll_hw_state does not need to be in global scope, so make it static. Cleans up sparse warning: "symbol 'cnl_ddi_dp_set_dpll_hw_state' was not declared. Should it be static?" Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/intel_dpll_mg

[PATCH][drm-next] drm/i915: fix spelling mistake: "CouarPoint" -> "CougarPoint"

2017-06-27 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in DRM_DEBUG_KMS message Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/i915_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index ee2325b180

[PATCH] drm/nouveau/therm: fix spelling mistake on array thresolds

2017-06-27 Thread Colin King
From: Colin Ian King Array thresolds should be named thresholds, rename it. Also make it static static const char * const Signed-off-by: Colin Ian King --- drivers/gpu/drm/nouveau/nvkm/subdev/therm/temp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm

[PATCH][drm-next] drm compat: ensure mode in drm_agp_info is being copied

2017-07-04 Thread Colin King
From: Colin Ian King A recent compat change removed the copying of i32.mode from info.mode. Add it back in to fix this removal as we currently are leaking information from the stack. Detected by CoverityScan, CID#1449374 ("Unitialized scalar variable") Fixes: 2337f2272ee1 ("compat_drm: switch A

[PATCH][drm-next] drm/amdgpu: make arrays pctl0_data and pctl1_data static

2017-07-06 Thread Colin King
From: Colin Ian King The arrays pctl0_data and pctl1_data do not need to be in global scope, so them both static. Cleans up sparse warnings: symbol 'pctl0_data' was not declared. Should it be static? symbol 'pctl1_data' was not declared. Should it be static? Signed-off-by: Colin Ian King ---

[PATCH] drm: vc4: remove redundant check of plane being non-null

2017-03-16 Thread Colin King
From: Colin Ian King The pointer plane is always null on the error path at label 'fail' hence the check if it is non-null is redundant. We can therefore remove the check and the destruction of plane as well as the fail error path and instead just return an -ENOMEM ERR_PTR. Detected by CoveritySc

[PATCH] drm/amdgpu: remove redundant outer loop and remove commented out code

2017-03-17 Thread Colin King
From: Colin Ian King The outer loop is redundant and can be removed as it is doing nothing useful. Also remove some commented out code that is not being used. Detected by CoverityScan, CID#1402073 Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 27 +++

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

2017-03-20 Thread 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, CID#1090730 ("Resource Leak") Fixes: 5736995b473b ("gma50

[PATCH] drm/i915/kvmgt: avoid dereferencing a potentially null info pointer

2017-03-23 Thread Colin King
From: Colin Ian King info is being checked to see if it is a null pointer, however, vpgu is dereferencing info before this check, leading to a potential null pointer dereference. If info is null, then the error message being printed by macro gvt_vgpu_err and this requires vpgu to exist. We can u

[PATCH] drm/sti:fix spelling mistake: "compoment" -> "component"

2017-05-13 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in DRM_ERROR message Signed-off-by: Colin Ian King --- drivers/gpu/drm/sti/sti_compositor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sti/sti_compositor.c b/drivers/gpu/drm/sti/sti_compositor.c inde

[PATCH] fix spelling mistake: "dimesions" -> "dimensions"

2017-05-14 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in DRM_ERROR message and split over two lines to clean up a "line over 80 characters" checkpatch warning. Signed-off-by: Colin Ian King --- drivers/gpu/drm/vc4/vc4_validate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --gi

[PATCH] drm/i915/guc:fix spelling mistake: "adddress" -> "address"

2017-05-16 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in seq_printf message. Fixes: a8b9370fc79c1 ("drm/i915/guc: Dump the GuC stage descriptor pool in debugfs") Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/i915_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

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

2017-05-17 Thread 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. Detected by CoverityScan, CID#1435469 ("Unsigned compared aga

[PATCH] drm/i915: Check C for null pointer rather than B

2017-05-18 Thread Colin King
From: Colin Ian King There are two occasions where pointer B is being check for a NULL when it should be pointer C instead. Fix these. Detected by CoverityScan, CID#1436348,1436349 ("Logically Dead Code") Fixes: 47624cc3301b60 ("drm/i915: Import the kfence selftests for i915_sw_fence") Signed-

[PATCH][drm-next] drm/pl111: make structure pl111_display_funcs static

2017-05-19 Thread Colin King
From: Colin Ian King structure pl111_display_funcs can be made static as it does not need to be in global scope. Fixes sparse warning: "warning: symbol 'pl111_display_funcs' was not declared. Should it be static?" Fixes: bed41005e6174d ("drm/pl111: Initial drm/kms driver for pl111") Signed-off

[PATCH] drm/pl111: make structure mode_config_funcs static

2017-05-19 Thread Colin King
From: Colin Ian King structure mode_config_funcs can be made static as it does not need to be in global scope. Fixes sparse warning: warning: symbol 'mode_config_funcs' was not declared. Should it be static? Fixes: bed41005e6174d ("drm/pl111: Initial drm/kms driver for pl111") Signed-off-by: C

[PATCH] [media] rainshadow-cec: ensure exit_loop is initialized

2017-05-19 Thread Colin King
From: Colin Ian King exit_loop is not being initialized, so it contains garbage. Ensure it is initialized to false. Detected by CoverityScan, CID#1436409 ("Uninitialzed scalar variable") Fixes: ea6a69defd3311 ("[media] rainshadow-cec: avoid -Wmaybe-uninitialized warning") Signed-off-by: Colin

[PATCH][V2] [media] rainshadow-cec: ensure exit_loop is intialized

2017-05-19 Thread Colin King
From: Colin Ian King exit_loop is not being initialized, so it contains garbage. Ensure it is initialized to false. Detected by CoverityScan, CID#1436409 ("Uninitialized scalar variable") Fixes: ea6a69defd3311 ("[media] rainshadow-cec: avoid -Wmaybe-uninitialized warning") Signed-off-by: Colin

[PATCH][drm-next] drm/i915: Check for allocation failure

2017-05-19 Thread Colin King
From: Colin Ian King The memory allocation for C is not being null checked and hence we could end up with a null pointer dereference. Fix this with a null pointer check. (I really should have noticed this when I was fixing an earlier issue.) Detected by CoverityScan, CID#1436406 ("Dereference nu

[PATCH] drm/vmwgfx: fix spelling mistake "exeeds" -> "exceeds"

2017-05-27 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in DRM_ERROR error message. Signed-off-by: Colin Ian King --- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgf

[PATCH][drm-next] drm/nouveau: fix non-ANSI function declaration of nouveau_pmops_runtime

2017-06-07 Thread Colin King
From: Colin Ian King Give function nouveau_pmops_runtime a void argument to make it an ANSI function declaration. Fixes sparse warning: warning: non-ANSI function declaration of function 'nouveau_pmops_runtime' Signed-off-by: Colin Ian King --- drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +- 1

[PATCH] drm/amd/powerplay: fix spelling mistake and add KERN_WARNING to printks

2016-10-24 Thread Colin King
From: Colin Ian King Fix trivial spelling mistake cant't -> can't and add KERN_WARNING to printk messages. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c | 4 ++-- drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c | 4 ++-- drivers/gpu/drm/amd/powerpl

[PATCH][V2] drm/amd/powerplay: fix spelling mistake and add KERN_WARNING to printks

2016-10-25 Thread Colin King
From: Colin Ian King Fix trivial spelling mistake cant't -> can't and add KERN_WARNING to printk messages. Remove redundant spaces before \n too (thanks to Joe Perches for spotting those). Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c | 4 ++-- drivers

[PATCH] drm/gma500: Fix possible null pointer dereference on sender

2016-09-15 Thread Colin King
From: Colin Ian King There is a null pointer sanity check on sender after sender is earlier dereferenced on the intialization of drm_device dev. Move this dereference to after sender is sanity checked to avoid the null pointer dereference. Issue found with static analysis using CoverityScan. Si

[PATCH][V2] drm/amdgpu: avoid out of bounds access on array interrupt_status_offsets

2016-09-20 Thread Colin King
From: Colin Ian King The check for an out of bound index into array interrupt_status_offsets is off-by-one. Fix this and also don't compared to a hard coded array size but use adev->mode_info.num_hpd instead. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 2 +- 1 fil

[PATCH] drm/amdgpu: avoid out of bounds access on array interrupt_status_offsets

2016-09-20 Thread Colin King
From: Colin Ian King The check for an out of bound index into array interrupt_status_offsets is off-by-one. Fix this and also don't compared to a hard coded array size but use ARRAY_SIZE instead. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 2 +- 1 file changed, 1

[PATCH] drm/nouveau/device: ensure ret is initialized to zero

2016-01-13 Thread Colin King
From: Colin Ian King nvkm_udevice_time does not initialize ret and this is used in the macro nvif_unpack(). Intializing it to zero allows the compiler to optimize out the ret == -ENOSYS check in the macro. Issue found by static analysis with cppcheck: [drivers/gpu/drm/nouveau/nvkm/engine/device/

[PATCH][next] drm/amdgpu: fix spelling mistake "Falied" -> "Failed"

2020-07-10 Thread Colin King
From: Colin Ian King There is a spelling mistake in a DRM_ERROR error message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/am

[PATCH][next] drm/i915/selftest: fix an error return path where err is not being set

2020-07-13 Thread Colin King
From: Colin Ian King There is an error condition where err is not being set and an uninitialized garbage value in err is being returned. Fix this by assigning err to an appropriate error return value before taking the error exit path. Addresses-Coverity: ("Uninitialized scalar value") Fixes: ed

[PATCH][next] drm/rockchip: lvds: ensure ret is assigned before checking for an error

2020-07-14 Thread Colin King
From: Colin Ian King Currently there are two places where the return status in ret is being checked for an error however the assignment of ret has been omitted making the checks redundant. Fix this by adding in the missing assignments of ret. Addresses-Coverity: ("Logically dead code") Fixes: c

[PATCH] drm/amd/display: remove redundant initialization of variable result

2020-07-23 Thread Colin King
From: Colin Ian King The variable result is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 2 +- 1

[PATCH] video: fbdev: fix setting of pixclock because a pass-by-value error

2020-07-23 Thread Colin King
From: Colin Ian King The pixclock is being set locally because it is being passed as a pass-by-value argument rather than pass-by-reference, so the computed pixclock is never being set in var->pixclock. Fix this by passing by reference. [This dates back to 2002, I found the offending commit from

[PATCH][next] drm/amdgpu: fix spelling mistake "Falied" -> "Failed"

2020-07-24 Thread Colin King
From: Colin Ian King There is a spelling mistake in a DRM_ERROR error message. Fix it. Signed-off-by: Colin Ian King --- Can folk please use checkpatch, it should catch these errors. --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH][next] drm: xln: fix spelling mistake "failes" -> "failed"

2020-07-24 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dev_dbg messages. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c index 821f7

[PATCH][next] drm/amd/display: fix incorrect assignment due to a typo

2020-04-23 Thread Colin King
From: Colin Ian King The assignment to infopacket->sb[7] looks incorrect, the comment states it is the minimum refresh rate yet it is being assigned a value from the maximum refresh rate max_refresh_in_uhz. Fix this by using min_refresh_in_uhz instead. Addresses-Coverity: ("Copy-paste error") Fi

[PATCH][next] drm/amd/display: remove redundant assignment to variable ret

2020-04-23 Thread Colin King
From: Colin Ian King The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/dc/c

[PATCH] amdgpu/dc: remove redundant assignment to variable 'option'

2020-04-24 Thread Colin King
From: Colin Ian King The variable option is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/

[PATCH][next] drm/amdgpu: fix unlocks on error return path

2020-04-24 Thread Colin King
From: Colin Ian King Currently the error returns paths are unlocking lock kiq->ring_lock however it seems this should be dev->gfx.kiq.ring_lock as this is the lock that is being locked and unlocked around the ring operations. This looks like a bug, fix it by unlocking the correct lock. [ Note:

[PATCH][next] drm/i915/gt: fix spelling mistake "evalution" -> "evaluation"

2020-04-28 Thread Colin King
From: Colin Ian King There is a spelling mistaking in a pr_notice message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gt/selftest_rps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/selftest_rps.c b/drivers/gpu/drm/i915/gt/self

[PATCH] drm/exynos: remove redundant initialization to variable 'start'

2020-05-07 Thread Colin King
From: Colin Ian King The variable 'start' is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/exynos/exyn

[PATCH][next] drm/amdgpu: remove redundant assignment to variable ret

2020-05-12 Thread Colin King
From: Colin Ian King The variable ret is being initializeed with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdg

[PATCH] drm/nouveau/bios/init: make two const arrays static, makes object smaller

2020-10-16 Thread Colin King
From: Colin Ian King Don't populate const arrays on the stack but instead make them static. Makes the object code smaller by 7 bytes. Before: textdata bss dec hex filename 1040418284 0 112325 1b6c5 drm/nouveau/nvkm/subdev/bios/init.o After: textdata b

[PATCH][next] drm/amd/pm: fix out-of-bound read on pptable->SkuReserved

2020-10-28 Thread Colin King
From: Colin Ian King A recent change added two uint16_t elements to PPTable_t and reduced the uint32_t array down to 8 elements. This results in the dev_info printing of pptable->SkuReserved[8] accessing a value that is out-of-range on array SkuReserved. The array has been shrunk by 1 element, s

[PATCH][next] drm/amdgpu: fix spelling mistake: "Successed" -> "Succeeded"

2020-11-02 Thread Colin King
From: Colin Ian King There is a spelling mistake in a deb_dbg message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/

[PATCH] drm/ast: fix missing break in switch statement for format->cpp[0] case 4

2020-06-10 Thread Colin King
From: Colin Ian King Currently the switch statement for format->cpp[0] value 4 assigns color_index which is never read again and then falls through to the default case and returns. This looks like a missing break statement bug. Fix this by adding a break statement. Addresses-Coverity: ("Unused v

[PATCH] drm/bridge: make array frs_limits static, makes object smaller

2020-06-11 Thread Colin King
From: Colin Ian King Don't populate the array frs_limits on the stack but instead make it static. Makes the object code smaller by 123 bytes Before: textdata bss dec hex filename 234565712 64 292327230 drivers/gpu/drm/bridge/tc358768.o After: textdata

[PATCH][next] drm/i915: fix a couple of spelling mistakes in kernel parameter help text

2020-06-16 Thread Colin King
From: Colin Ian King There are a couple of spelling mistakes in kernel parameter help text, namely "helpfull" and "paramters". Fix them. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/i915_params.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm

[PATCH] drm/i915/display: fix missing null check on allocated dsb object

2020-06-16 Thread Colin King
From: Colin Ian King Currently there is no null check for a failed memory allocation on the dsb object and without this a null pointer dereference error can occur. Fix this by adding a null check. Note: added a drm_err message in keeping with the error message style in the function. Addresses-C

[PATCH][next] drm/i915/selftests: fix spelling mistake "submited" -> "submitted"

2020-06-17 Thread Colin King
From: Colin Ian King There is a spelling mistake in a pr_err message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gt/selftest_lrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_

[PATCH][next] drm/mm/selftests: fix unsigned comparison with less than zero

2020-06-17 Thread Colin King
From: Colin Ian King Function get_insert_time can return error values that are cast to a u64. The checks of insert_time1 and insert_time2 check for the errors but because they are u64 variables the check for less than zero can never be true. Fix this by casting the value to s64 to allow of the ne

[PATCH] drm/fbdev: fix a memory leak on the dmt_mode object

2020-06-17 Thread Colin King
From: Colin Ian King Object drm_mode is allocated by the call to drm_mode_find_dmt (via the call to drm_mode_duplicate and drm_mode_create). The object is never free'd and hence causes a small memory leak. Fix this by kfree'ing drm_mode once it is no longer required. Addresses-Coverity: ("Resour

[PATCH] drm/arm: fix unintentional integer overflow on left shift

2020-06-18 Thread Colin King
From: Colin Ian King Shifting the integer value 1 is evaluated using 32-bit arithmetic and then used in an expression that expects a long value leads to a potential integer overflow. Fix this by using the BIT macro to perform the shift to avoid the overflow. Addresses-Coverity: ("Unintentional i

[PATCH] drm/amdgpu: remove redundant initialization of variable ret

2020-06-18 Thread Colin King
From: Colin Ian King The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdg

[PATCH] drm/radeon: fix array out-of-bounds read and write issues

2020-06-24 Thread Colin King
From: Colin Ian King There is an off-by-one bounds check on the index into arrays table->mc_reg_address and table->mc_reg_table_entry[k].mc_data[j] that can lead to reads and writes outside of arrays. Fix the bound checking off-by-one error. Addresses-Coverity: ("Out-of-bounds read/write") Fixes

[PATCH][next] drm: amdgpu: fix premature goto because of missing braces

2020-06-24 Thread Colin King
From: Colin Ian King Currently the goto statement is skipping over a lot of setup code because it is outside of an if-block and should be inside it. Fix this by adding missing if statement braces. Addresses-Coverity: ("Structurally dead code") Fixes: fd151ca5396d ("drm amdgpu: SI UVD v3_1") Sign

[PATCH][next] drm/amdgpu: ensure 0 is returned for success in jpeg_v2_5_wait_for_idle

2020-06-24 Thread Colin King
From: Colin Ian King In the cases where adev->jpeg.num_jpeg_inst is zero or the condition adev->jpeg.harvest_config & (1 << i) is always non-zero the variable ret is never set to an error condition and the function returns an uninitialized value in ret. Since the only exit condition at the end i

[PATCH] drm/virtgpu: remove redundant assignments to width and height

2020-07-01 Thread Colin King
From: Colin Ian King Variables width and height are being assigned values that are never read. The assignments are redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/virtio/virtgpu_display.c | 2 -- 1 file changed, 2 deletions(-

[PATCH] drm/amd/display: remove redundant initialization of variable result

2020-07-01 Thread Colin King
From: Colin Ian King The variable result is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/

[PATCH][next] drm/vmwgfx: fix spelling mistake "Cound" -> "Could"

2020-03-26 Thread Colin King
From: Colin Ian King There is a spelling mistake in a DRM_ERROR error message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx

[PATCH][next] drm/amdgpu/vcn: fix spelling mistake "fimware" -> "firmware"

2020-04-01 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dev_err error message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdg

[PATCH][next] drm/vmwgfx: remove redundant assignment to variable ret

2020-04-05 Thread Colin King
From: Colin Ian King The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/vmwgfx/vmwgfx_su

[PATCH] drm/i915: remove redundant assignment to variable err

2020-04-09 Thread Colin King
From: Colin Ian King The variable err is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gem/selfte

[PATCH] drm/amd/display: remove redundant assignment to variable dp_ref_clk_khz

2020-04-10 Thread Colin King
From: Colin Ian King The variable dp_ref_clk_khz is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/

[PATCH] drm/i915/gt: remove redundant assignment to variable x

2020-04-10 Thread Colin King
From: Colin Ian King The variable x is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gt/intel_eng

[PATCH] drm/amdgpu: ensure device_list is initialised before calling list_add_tail

2020-04-10 Thread Colin King
From: Colin Ian King Currently the call to list_add_tail will access an the uninitalised device_list.prev. Fix this by ensuring device_list is initialized before adding items to it. Addresses-Coverity: ("Uninitialized pointer read") Fixes: b3dbd6d3ec49 ("drm/amdgpu: resolve mGPU RAS query instab

[PATCH][next] drm/rockchip: fix spelling mistake "modifer" -> "modifier"

2020-04-15 Thread Colin King
From: Colin Ian King There is a spelling mistake in a DRM_DEBUG_KMS debug message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gp

[PATCH][next] drm/i915: remove redundant assignment to variable test_result

2020-04-17 Thread Colin King
From: Colin Ian King The variable test_result is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/di

[PATCH][next] drm/amdgpu: fix a dereference on pointer hive before it is null checked

2020-04-20 Thread Colin King
From: Colin Ian King Currently pointer hive is being dereferenced before it is being null checked and hence can lead to null pointer dereference issues. Fix this by only dereferencing pointer hive after it has been null checked. Addresses-Coverity: ("Dereference before null check") Fixes: 25d427

<    1   2   3   4   5   >