[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

[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

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

[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

[PATCH] 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. 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 ++--

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

[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

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

[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

[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

[PATCH] drm/hisilicon: add back missing } on ade_dc_ops

2016-08-17 Thread Colin King
From: Colin Ian King Fix build error by adding back the closing } on ade_dc_ops which got accidentally removed from an earlier commit. Fixes: d25bcfb8c2e18b9b36 ("Don't set drm_device->platformdev") Signed-off-by: Colin Ian King ---

[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

[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

[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

[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

[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

[PATCH] drm/vc4: clean up error exit path on failed dpi_connector allocation

2016-06-02 Thread Colin King
From: Colin Ian King There is redundant code in the clean up exit path when dpi_connector fails to be allocated. The current code checks if connector is NULL before destroying it, in fact, connector is NULL at this point so the check is redundant and can be removed.

[PATCH] drm/nouveau/iccsense: fix memory leak on default sensor->type case

2016-06-02 Thread Colin King
From: Colin Ian King The default sensor->type case leaks memory allocated to rail. Fix this by free'ing rail before we continue with the next loop iteration. Signed-off-by: Colin Ian King --- drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c | 1 + 1 file changed,

[PATCH] drm/fb_cma_helper: remove duplicate const from drm_fb_cma_alloc

2016-01-20 Thread Colin King
From: Colin Ian King Duplicated const, only one is required. Also reformat line to ensure it is less than 80 columns wide. Signed-off-by: Colin Ian King --- drivers/gpu/drm/drm_fb_cma_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH] drm/amdgpu: fix non-ANSI declaration of amdgpu_amdkfd_gfx_*_get_functions()

2016-01-22 Thread Colin King
From: Colin Ian King amdgpu_amdkfd_gfx_7_get_functions and amdgpu_amdkfd_gfx_8_0_get_functions have no parameters, so use the normal void parameter convention to make them match their prototypes in the header file drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h

[PATCH] drm/vc4: remove redundant ret status check

2016-07-10 Thread Colin King
From: Colin Ian King At the current point where ret is being checked for non-zero it has not changed since it was initialized to zero, hence the check and the label unref are redundant and can be removed. Signed-off-by: Colin Ian King ---

[PATCH] drm/amdkfd: print doorbell offset as a hex value

2016-07-13 Thread Colin King
From: Colin Ian King The doorbell offset is formatted with a 0x prefix to suggest it is a hexadecimal value, when in fact %d is being used and this is confusing. Use %X instead to match the proceeding 0x prefix. Signed-off-by: Colin Ian King ---

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

[PATCH] drm/amd/amdgpu: fix spelling mistake: "comleted" -> "completed"

2016-12-29 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in WARN message Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

[PATCH] drm/nouveau/bios: fix spelling mistake: "INIT_GENERIC_CONDITON" -> "INIT_GENERIC_CONDITION"

2016-12-29 Thread Colin King
From: Colin Ian King trivial fix to spelling mistake in warn message Signed-off-by: Colin Ian King --- drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c

[PATCH] drm/amd/powerplay: fix memory leak of tdp_table

2016-03-18 Thread Colin King
From: Colin Ian King tdp_table is being leaked on failed allocations of hwmgr->dyn_state.cac_dtp_table. kfree tdp_table on the error return path to fix the leak. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c | 4 +++- 1

[PATCH] drm/amd/powerplay: fix memory leak on tdp_table

2016-03-21 Thread Colin King
From: Colin Ian King tdp_table is being leaked on an error exit return path, fix this by kfree'ing it. Also swap comparison around to make the patch warning free with checkpatch. Leak found via static analysis with CoverityScan Signed-off-by: Colin Ian King ---

[PATCH] gma500: fix missing comma in dsi_errors array initializer

2016-03-22 Thread Colin King
From: Colin Ian King There is a missing comma between two strings in the dsi_errors[] array initializer, causing two strings to be concatenated and the array being incorrectly initialized. Add in the missing comma. Signed-off-by: Colin Ian King ---

[PATCH] drm/radeon/dpm: ensure ret is not returning uninitialized value

2014-02-06 Thread Colin King
From: Colin Ian King ret is not being initialized, so there is a possibility that a garbage value is being returned by kv_dpm_late_enable(). Initialize ret to 0 to fix this. Signed-off-by: Colin Ian King --- drivers/gpu/drm/radeon/kv_dpm.c | 2 +- 1 file changed, 1

[PATCH] drm/vmwgfx: fix asssignment of vmw_bo_p to NULL

2014-08-16 Thread Colin King
From: Colin Ian King cppcheck detected an incorrect assignment: [drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:903]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? the original assigment didn't do anything,

[PATCH] drm/qxl: add locking to prevent race on garbage collection

2015-12-09 Thread Colin King
From: Colin Ian King I've seen the driver break a few times in qxl_garbage_collect and I believe this is a race condition on qxl_release_free. Adding extra locking around the release free addresses the breakage. Signed-off-by: Colin Ian King ---

[PATCH] drm/nouveau: usif_ioctl: ensure returns are initialized

2015-07-01 Thread Colin King
From: Colin Ian King Various usif_ioctl helper functions do not initialize the return variable ret and some of the error handling return paths just return garbage values that were on the stack (or in a register). I believe that in all the cases, the initial ret

[PATCH] drm/vmwgfx: Correctly NULLify dma buffer pointer on failure

2015-01-22 Thread Colin King
From: Colin Ian King cppcheck on lines 917 and 977 show an ineffective assignment to the dma buffer pointer: [drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:917]: [drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:977]: (warning) Assignment of function parameter has no effect

[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

[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

[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")

[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

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

[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

[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

[PATCH][drm-next] drm/i915: make structure intel_sprite_plane_funcs static

2017-08-11 Thread Colin King
From: Colin Ian King The structure intel_sprite_plane_funcs is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'intel_sprite_plane_funcs' was not declared. Should it be static? Signed-off-by: Colin Ian

[PATCH] drm/nouveau: remove redundant null check on array mstm->msto

2017-08-17 Thread Colin King
From: Colin Ian King The check to see if mstm->msto is null is redundant because it is an array and hence can never be null. Remove the redundant check. Detected by CoverityScan, CID#1375915 ("Array compared against 0") Signed-off-by: Colin Ian King

[PATCH] drm/amdgpu: fix spelling mistake: "suuport"-> "support"

2017-07-24 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in WARN_ONCE message Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

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

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

[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

[PATCH] drm/msm: fix spelling mistake: "ringubffer" -> "ringbuffer"

2017-08-05 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in DRM_DEV_ERROR error message Signed-off-by: Colin Ian King --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH][V2] drm/nouveau: perform null check on msto[i] rathern than msto

2017-08-17 Thread Colin King
From: Colin Ian King The null check on the array msto is incorrect since msto is never null. The null check should be instead on msto[i] since this is being dereferenced in the call to drm_mode_connector_attach_encoder. Thanks to Emil Velikov for pointing out the

[PATCH][drm-next] drm/amdgpu: remove duplicate return statement

2017-08-23 Thread Colin King
From: Colin Ian King Remove a redundant identical return statement, it has no use. Detected by CoverityScan, CID#1454586 ("Structurally dead code") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c | 1 - 1

[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

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

[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

[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

[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

[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

[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

[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

[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

[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

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

[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

[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

[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

[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

[PATCH] drm/i915: remove redundant variable hw_check

2017-09-14 Thread Colin King
From: Colin Ian King hw_check is being assigned and updated but is no longer being read, hence it is redundant and can be removed. Detected by clang scan-build: "warning: Value stored to 'hw_check' during its initialization is never read" Fixes: f6d1973db2d2

[PATCH] dma-buf: remove redundant initialization of sg_table

2017-09-14 Thread Colin King
From: Colin Ian King sg_table is being initialized and is never read before it is updated again later on, hence making the initialization redundant. Remove the initialization. Detected by clang scan-build: "warning: Value stored to 'sg_table' during its initialization

[PATCH][drm-next] drm/tve200: make two functions static

2017-09-22 Thread Colin King
From: Colin Ian King The functions tve200_display_disable and tve200_display_funcs are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'tve200_display_disable' was not declared. Should it be static?

[PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-19 Thread Colin King
From: Colin Ian King An earlier fix changed the return type from find_bb_size however the integer return is being assigned to a unsigned int so the -ve error check will never be detected. Make bb_size an int to fix this. Detected by CoverityScan CID#1456886 ("Unsigned

[PATCH] drm/i915: remove redundant check on has_aliasing_ppgtt

2017-10-10 Thread Colin King
From: Colin Ian King There is a previous check to on has_aliasing_ppgtt that returns 0 if it is false, so it is impossible for has_aliasing_ppgtt to be false on the final return of function intel_sanitize_enable_ppgtt, so final return in the function always will return

[PATCH][drm-next] drm/amdgpu: make function uvd_v6_0_enc_get_destroy_msg static

2017-10-11 Thread Colin King
From: Colin Ian King The function uvd_v6_0_enc_get_destroy_msg is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'uvd_v6_0_enc_get_destroy_msg' was not declared. Should it be static? Signed-off-by:

[PATCH] drm/vc4: clean up error handling on devm_kzalloc failure

2017-09-08 Thread Colin King
From: Colin Ian King The current error handling on devm_kzalloc failures performs a non-null check on connector. Thss check is redundant because connector is null at that failure point. With this check removed, we may as well make the failure path into a trivial

[PATCH][V2] drm/vc4: clean up error handling on devm_kzalloc failure

2017-09-08 Thread Colin King
From: Colin Ian King The current error handling when devm_kzalloc fails performs a non-null check on connector which is redundant because connector is null at that failure point. Once this is removed, make the failure path into a trivial -ENOMEM return to clean up the

[PATCH] drm/amdkfd: check for null dev to avoid a null pointer dereference

2017-09-08 Thread Colin King
From: Colin Ian King The call to kfd_device_by_id can potentially return null, so check that dev is null and return with -EINVAL to avoid a null pointer dereference. Detected by CoverityScan CID#1454629 ("Dereference null return value") Fixes: 5d71dbc3a588

[PATCH] drm: qxl: ratelimit pr_info message, reduce log spamming

2017-09-12 Thread Colin King
From: Colin Ian King Simply mmap'ing /dev/dri/card0 repeatedly will spam the kernel log with qxl_mmap information messages. The following example code illustrates this: int main(void) { int fd = open("/dev/dri/card0", O_RDONLY); if (fd == -1)

[PATCH][V2] drm: qxl: remove pr_info message, stops log spamming

2017-09-12 Thread Colin King
From: Colin Ian King Simply mmap'ing /dev/dri/card0 repeatedly will spam the kernel log with qxl_mmap information messages. The following example code illustrates this: int main(void) { int fd = open("/dev/dri/card0", O_RDONLY); if (fd == -1)

[PATCH] drm/vmwgfx: remove DRM_ERROR message, stops log spamming

2017-09-12 Thread Colin King
From: Colin Ian King mmap'ing the device multiple times will spam the kernel log with the DRM_ERROR message about illegal mmap'ing the old fifo space. Since the mmap'ing will fail with an -EINVAL there is no need to emit this message, so just remove it. Signed-off-by:

[PATCH][drm-next] drm/amd/powerplay: fix spelling mistake: "dividable" -> "divisible"

2017-09-28 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistakes in pr_err error message and ASSERT messages. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/powerplay/smumgr/ci_smc.c | 2 +-

[PATCH][drm-next] drm/radeon: make functions alloc_pasid and free_pasid static

2017-09-28 Thread Colin King
From: Colin Ian King The functions alloc_pasid and free_pasid are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: warning: symbol 'alloc_pasid' was not declared. Should it be static? warning: symbol

[PATCH] video: fbdev: remove redundant self assignment of 'height'

2017-11-23 Thread Colin King
From: Colin Ian King The assignment of height to itself is redundant and can be removed. Detected with Coccinelle. Signed-off-by: Colin Ian King --- drivers/video/fbdev/vga16fb.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH] drm/amd/display: fix memory leaks on error exit return

2017-11-22 Thread Colin King
From: Colin Ian King Currently in the case where some of the allocations fail for dce110_tgv, dce110_xfmv, dce110_miv or dce110_oppv then the exit return path ends up leaking allocated objects. Fix this by kfree'ing them before returning. Also re-work the comparison of

[PATCH][next] drm/i915/gvt: fix off-by-one comparison of ring_id

2017-12-04 Thread Colin King
From: Colin Ian King The ring_id maximum boundary is being compared using the > operator instead of >=, leading to an off-by-one error and an out of bounds write into array vgpu->hws_pga[]. Fix this by simply using the correct comparison operator. Also re-work another

[PATCH] drm/amd/display: remove redundant null check of array 'data'

2017-12-15 Thread Colin King
From: Colin Ian King The null check on aconnector->base.edid_blob_ptr->data is redundant since data is an array and can never be null. Remove it. Detected by CoverityScan, CID#1460369 ("Array compared against 0") Signed-off-by: Colin Ian King

[PATCH] omapdrm: hdmi4_cec: fix unsigned int comparison with less than zero

2017-11-17 Thread Colin King
From: Colin Ian King The two comparisons of the unsigned int ret for -ve error returns is always false because ret is unsigned. Fix this by making ret a signed int. Signed-off-by: Colin Ian King --- drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c |

[PATCH] drm/amdgpu/virt: remove redundant variable pf2vf_ver

2017-11-11 Thread Colin King
From: Colin Ian King Variable pf2vf_ver is assigned but never read, it is redundant and hence can be removed. Cleans up clang warning: drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c:310:3: warning: Value stored to 'pf2vf_ver' is never read Signed-off-by: Colin Ian King

[PATCH] video: fbdev: sm501fb: fix potential null pointer dereference on fbi

2017-11-10 Thread Colin King
From: Colin Ian King The pointer fbi is dereferenced with par = fbi->par before there is a null check on fbi, hence there is a potential null pointer dereference on a null par. Fix this by moving the dereference after the null pointer check. Detected by CoverityScan,

[PATCH] drm/amd/display: remove unnecessary cast and use kcalloc instead of kzalloc

2017-11-15 Thread Colin King
From: Colin Ian King Use kcalloc instead of kzalloc and the cast on the return from kzalloc is unnecessary and can be removed. Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/dc/basics/logger.c | 5 ++--- 1 file changed, 2

[PATCH] backlight: ili922x: remove redundant variable len

2017-11-05 Thread Colin King
From: Colin Ian King The variable len is assigned but never read, therefore it is redundant and can be removed. Cleans up clang warning: drivers/video/backlight/ili922x.c:276:2: warning: Value stored to 'len' is never read Signed-off-by: Colin Ian King

[PATCH] drm/nouveau/bios: make const arrays hwsq_signature and edid_sig static

2017-11-02 Thread Colin King
From: Colin Ian King Don't populate arrays hwsq_signature and edid_sig on the stack but instead make them static. Makes the object code smaller by over 190 bytes: Before: textdata bss dec hex filename 356763312 64 39052988c

[PATCH] drm/msm: fix spelling mistake: "ringubffer" -> "ringbuffer"

2017-11-02 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in DRM_DEV_ERROR error message Signed-off-by: Colin Ian King --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] drm/amd/powerplay: fix copy-n-paste error on vddci_buf index

2017-11-09 Thread Colin King
From: Colin Ian King The index to vddci_buf is using profile->ucElbVDDC_Num rather than profile->ucElbVDDCI_Num; this looks like a copy-n-paste error from previous code for the vddc_buf array and I'm pretty sure this is incorrect. Fix this by using the correct variable.

[PATCH] video: fbdev: intelfb: remove redundant variables

2017-11-06 Thread Colin King
From: Colin Ian King Variables err_max, err_target and f_best are being assigned values but these are never read, hence they are redundant variables and can be removed. Cleans up clang warnings: drivers/video/fbdev/intelfb/intelfbhw.c:946:2: warning: Value stored to

[PATCH][next] drm/i915/gvt: Add missing breaks in switch statement

2017-12-04 Thread Colin King
From: Colin Ian King The switch statement is missing breaks for the cases of GVT_FAILSAFE_INSUFFICIENT_RESOURCE and GVT_FAILSAFE_GUEST_ERR. Add them in. Detected by CoverityScan, CID#1462416 ("Missing break in switch") Fixes: e011c6ce2b4f ("drm/i915/gvt: Add VM

[PATCH] video: fbdev: nvidia: fix spelling mistake: "scaleing" -> "scaling"

2018-05-08 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in module parameter description text Signed-off-by: Colin Ian King --- drivers/video/fbdev/nvidia/nvidia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

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

2018-05-08 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in gvt_dbg_core debug message Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gvt/vgpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] drm/i915/dp: fix spelling mistake: "seqeuncer" -> "sequencer"

2018-05-09 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in WARN warning message text Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH][V2] drm/i915/dp: fix spelling mistakes: "seqeuncer" and "seqeuencer"

2018-05-09 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistakes in WARN warning message text and in comments: "seqeuncer", "seqeuencer" -> "sequencer" Signed-off-by: Colin Ian King --- V2: Also fix seqeuencer in comments ---

[PATCH][next] drm/xen-front: fix spelling mistake: "conector" -> "connector"

2018-05-15 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in DRM_INFO message. Signed-off-by: Colin Ian King --- drivers/gpu/drm/xen/xen_drm_front.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH][next] drm/amd/pp: initialized result to zero before or'ing in data

2018-06-06 Thread Colin King
From: Colin Ian King The current use of result is or'ing in values and checking for a non-zero result, however, result is not initialized to zero so it potentially contains garbage to start with. Fix this by initializing it to the first return from the call to

[PATCH][V3] drm/i915/guc: fix GEM_BUG_ON check

2018-06-12 Thread Colin King
From: Colin Ian King The check for level being less than zero always false because flags is currently unsigned and can never be negative. Fix this by making level a s32. Detected by CoverityScan, CID#1468363 ("Macro compares unsigned to 0") Fixes: cb5d64e9f13e ("drm/i915/guc: Allow user to

[PATCH][V2] drm/i915/guc: fix GEM_BUG_ON check

2018-06-11 Thread Colin King
From: Colin Ian King The check for level being less than zero always false because flags is currently unsigned and can never be negative. Fix this by making flags a s32. Detected by CoverityScan, CID#1468363 ("Macro compares unsigned to 0") Signed-off-by: Colin Ian King --- V2: Make flags

  1   2   3   4   5   >