Re: [Intel-gfx] [PULL] gvt-fixes

2022-08-19 Thread Colin King (gmail)
On 17/08/2022 21:07, Vivi, Rodrigo wrote: On Tue, 2022-08-16 at 12:43 +0800, Zhenyu Wang wrote: On 2022.08.16 12:05:08 +0800, Zhenyu Wang wrote: On 2022.08.15 19:32:45 -0400, Rodrigo Vivi wrote: On Mon, Aug 15, 2022 at 10:38:55AM +0800, Zhenyu Wang wrote: Hi, Here's one gvt-fixes pull for

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

2021-10-12 Thread Colin King
From: Colin Ian King The assignment of pointer backup_bo dereferences pointer backup before backup is null checked, this could lead to a null pointer dereference issue. Fix this by only assigning backup_bo after backup has been null checked. Addresses-Coverity: ("Dereference before null check")

[Intel-gfx] [PATCH] drm/i915/gt: return NULL rather than a plain 0 integer

2021-09-25 Thread Colin King
From: Colin Ian King Function gen7_ctx_vma returns a pointer to struct i915_vma, so returning a plain 0 integer isn't good practice. Fix this by returning a NULL instead. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gt/intel_ring_submission.c | 2 +- 1 file changed, 1 insertion(+),

[Intel-gfx] [PATCH] drm/i915/gvt: Fix spelling mistake "Unsupport" -> "Unsupported"

2021-09-24 Thread Colin King
From: Colin Ian King There is a spelling mistake in a gvt_vgpu_err error message. Fix it. 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

[Intel-gfx] [PATCH][next] drm/i915: make array states static const

2021-09-15 Thread Colin King
From: Colin Ian King Don't populate the read-only array states on the stack but instead it static. Also makes the object code smaller. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/display/intel_display_power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Intel-gfx] [PATCH][next] drm/i915: clean up inconsistent indenting

2021-09-02 Thread Colin King
From: Colin Ian King There is a statement that is indented one character too deeply, clean this up. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Intel-gfx] [PATCH][next] drm/i915/xelpd: Fix unsigned compared to less than zero error

2021-07-20 Thread Colin King
From: Colin Ian King The subtraction of fw->size - offset is operating on two unsigned integers and the result is unsigned and hence the less than zero comparison will always to be false. Fix this by casting fw->size from a size_t to a ssize_t to ensure the result can be signed to allow a less

[Intel-gfx] [PATCH][next] drm/i915: Fix an uninitialized variable issue

2021-04-01 Thread Colin King
From: Colin Ian King Currently there is a while loop that contains a handful of continue statements that can skip over the assignment of the variable err. At the end of the loop there is a potiential for err to be unassigned and possibly causing issues when err is checked for a non-zero value.

[Intel-gfx] [PATCH] i915: Fix uninitialized variable err

2021-03-29 Thread Colin King
From: Colin Ian King In the case where !sg_dma_len(sgl) breaks out of the do-while loop on the first iteration, error variable err has not been assigned any value and will contain garbage. Fix this by ensuring err is initialized to zero. Addresses-Coverity: ("Uninitialized scalar variable")

[Intel-gfx] [PATCH][next] drm/i915/hdcp: Fix null pointer dereference of connector->encoder

2021-02-23 Thread Colin King
From: Colin Ian King The recent commit 6c63e6e14da7 ("drm/i915/hdcp: No HDCP when encoder is't initialized") added a null pointer check on connector->encoder hence implying that it could potentially be null. This means that the initialization of dig_port via the call intel_attached_dig_port may

[Intel-gfx] [PATCH][next] drm/i915/display: Fix spelling mistake "Couldnt" -> "Couldn't"

2021-02-09 Thread Colin King
From: Colin Ian King There is a spelling mistake in a drm_dbg message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c

[Intel-gfx] [PATCH][next] drm/i915/display: fix spelling mistake "Couldnt" -> "Couldn't"

2021-02-03 Thread Colin King
From: Colin Ian King There is a spelling mistake in a drm_dbg message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c

[Intel-gfx] [PATCH][next] drm/i915/hdcp: Fix return of value in uninitialized variable ret

2021-01-22 Thread Colin King
From: Colin Ian King Currently when there are other connectors on the port using HDCP the function _intel_hdcp_disable returns a garbage uninitialized value in variable ret. I believe the intention is to return 0, so return this literal value instead of the value in ret. Addresses-Coverity:

[Intel-gfx] [PATCH][next] drm/i915/dp: fix spelling contraction "couldnt" -> "couldn't"

2021-01-15 Thread Colin King
From: Colin Ian King There is a spelling contraction mistake in a drm_dbg message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c

[Intel-gfx] [PATCH][next] drm/i915: fix size_t greater or equal to zero comparison

2020-10-02 Thread Colin King
From: Colin Ian King Currently the check that the unsigned size_t variable i is >= 0 is always true because the unsigned variable will never be negative, causing the loop to run forever. Fix this by changing the pre-decrement check to a zero check on i followed by a decrement of i.

[Intel-gfx] [PATCH] drm/i915/vlv_dsi_pll: fix spelling mistake "Cant" -> "Can't"

2020-08-10 Thread Colin King
From: Colin Ian King There is a spelling mistake in a drm_err message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/display/vlv_dsi_pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c

[Intel-gfx] [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:

[Intel-gfx] [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

[Intel-gfx] [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.

[Intel-gfx] [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

[Intel-gfx] [PATCH][next] drm/i915: fix incorrect return of an error status

2020-05-18 Thread Colin King
From: Colin Ian King Currently when a call to intel_atomic_get_dbuf_state fails the error value being returns is a potentially uninitialized value in variable ret. Fix this by returning the error value of new_dbuf_state. Addresses-Coverity: ("Uninitialized scalar value") Fixes: 3cf43cdc63fb

[Intel-gfx] [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

[Intel-gfx] [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 ---

[Intel-gfx] [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 ---

[Intel-gfx] [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 ---

[Intel-gfx] [PATCH] drm/i915/gt: remove redundant assignment to variable dw

2020-02-22 Thread Colin King
From: Colin Ian King Variable dw is being initialized with a value that is never read, it is assigned a new value later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 2 +-

[Intel-gfx] [PATCH][next] drm/i915/gem: fix null pointer dereference on vm

2020-01-23 Thread Colin King
From: Colin Ian King Currently if the call to function context_get_vm_rcu returns a null pointer for vm then the error exit path via label err_put will call i915_vm_put on the null vm, causing a null pointer dereference. Fix this by adding a null check on vm and returning without calling the

[Intel-gfx] [PATCH][next] drm/i915: fix uninitialized pointer reads on pointers to and from

2019-12-19 Thread Colin King
From: Colin Ian King Currently pointers to and from are not initialized and may contain garbage values. This will cause uninitialized pointer reads in the call to intel_frontbuffer_track and later checks to see if to and from are null. Fix this by ensuring to and from are initialized to NULL.

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [PATCH][next] drm/i915/selftests: fix uninitialized variable sum when summing up values

2019-12-10 Thread Colin King
From: Colin Ian King Currently the variable sum is not uninitialized and hence will cause an incorrect result in the summation values. Fix this by initializing sum to the first item in the summation. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 3c7a44bbbfa7

[Intel-gfx] [PATCH][next] drm/i915/selftests: fix null pointer dereference on pointer data

2019-10-09 Thread Colin King
From: Colin Ian King In the case where data fails to be allocated the error exit path is via label 'out' where data is dereferenced in a for-loop. Fix this by exiting via the label 'out_file' instead to avoid the null pointer dereference. Addresses-Coverity: ("Dereference after null check")

[Intel-gfx] [PATCH][next] drm/i915: remove redundant variable err

2019-10-09 Thread Colin King
From: Colin Ian King An earlier commit removed any error assignments to err and we are now left with a zero assignment to err and a check that is always false. Clean this up by removing the redundant variable err and the error check. Addresses-Coverity: ("'Constant' variable guard")

[Intel-gfx] [PATCH] drm/i915: make array hw_engine_mask static, makes object smaller

2019-10-07 Thread Colin King
From: Colin Ian King Don't populate the array hw_engine_mask on the stack but instead make it static. Makes the object code smaller by 316 bytes. Before: textdata bss dec hex filename 340044388 320 387129738 gpu/drm/i915/gt/intel_reset.o After: text

[Intel-gfx] [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

[Intel-gfx] [PATCH][next] drm/i915: fix use of uninitialized pointer vaddr

2019-05-31 Thread Colin King
From: Colin Ian King The assignment of err is using the incorrect pointer vaddr that has not been initialized. Fix this by using the correct pointer obj instead. Addresses-Coverity: ("Uninitialized pointer read") Fixes: 6501aa4e3a45 ("drm/i915: add in-kernel blitter client") Signed-off-by:

[Intel-gfx] [PATCH][next] drm/i915: fix uninitialized variable 'subslice_mask'

2019-05-29 Thread Colin King
From: Colin Ian King Currently subslice_mask is not initialized and so data is being bit-wise or'd into a garbage value. Fix this by inintializing subslice_mask to zero. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 1ac159e23c2c ("drm/i915: Expand subslice mask") Signed-off-by:

[Intel-gfx] [PATCH][next] drm/i915: fix uninitialized variable 'mask'

2019-05-29 Thread Colin King
From: Colin Ian King Currently mask is not initialized and so data is being bit-wise or'd into a garbage value. Fix this by inintializing mask to zero. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 1ac159e23c2c ("drm/i915: Expand subslice mask") Signed-off-by: Colin Ian King ---

[Intel-gfx] [PATCH][next] drm/i915/gtt: set err to -ENOMEM on memory allocation failure

2019-05-24 Thread Colin King
From: Colin Ian King Currently when the allocation of ppgtt->work fails the error return path via err_free returns an uninitialized value in err. Fix this by setting err to the appropriate error return of -ENOMEM. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: d3622099c76f

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

2019-04-18 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

[Intel-gfx] [PATCH][next] drm/i915/selftests: fix memory leak of 'spin'

2019-02-19 Thread Colin King
From: Colin Ian King There is a memory leak of 'spin' on an error return path. Fix this by kfree'ing spin before the return. Fixes: c06ee6ff2cbc ("drm/i915/selftests: Context SSEU reconfiguration tests") Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/selftests/i915_gem_context.c | 4

[Intel-gfx] [PATCH] drm/i915/gvt: fix spelling mistake "Interupts" -> "Interrupts"

2018-11-25 Thread Colin King
From: Colin Ian King There is a spelling mistake in an error message, fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gvt/interrupt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/interrupt.c b/drivers/gpu/drm/i915/gvt/interrupt.c

[Intel-gfx] [PATCH][drm-next] drm/i915/csr: fix spelling mistake "firmare" -> "firmware"

2018-11-07 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/i915/intel_csr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c index

[Intel-gfx] [PATCH][next] drm/i915/psr: fix copy-paste error with setting of tp2_wakeup_time_us

2018-06-20 Thread Colin King
From: Colin Ian King Currently for the psr_table->tp2_tp3_wakeup_time case 3 there appears to be a copy-paste error from the previous switch statement where dev_priv->vbt.psr.tp1_wakeup_time_us is being assigned and I believe it should be dev_priv->vbt.psr.tp2_tp3_wakeup_time_us that should be

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [PATCH] drm/i915/guc: remove redundant GEM_BUG_ON check

2018-06-11 Thread Colin King
From: Colin Ian King The check for level being less than zero is redundant as level is an unsigned u32 and hence will never be less than zero. Remove this redundant check. Detected by CoverityScan, CID#1468363 ("Macro compares unsigned to 0") Signed-off-by: Colin Ian King ---

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

2018-05-30 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in gvt_dbg_core message 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 index

[Intel-gfx] [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 ---

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [PATCH] drm/i915/selftests: fix spelling mistake: "parmaters" -> "parameters"

2018-05-03 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in pr_err error message Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Intel-gfx] [PATCH] drm/i915/gvt: fix memory leak of a cmd_entry struct on error exit path

2018-04-10 Thread Colin King
From: Colin Ian King The error exit path when a duplicate is found does not kfree and cmd_entry struct and hence there is a small memory leak. Fix this by kfree'ing it. Detected by CoverityScan, CID#1370198 ("Resource Leak") Fixes: be1da7070aea ("drm/i915/gvt: vGPU

[Intel-gfx] [PATCH] drm/i915/gvt: don't dereference 'workload' before null checking it

2018-03-21 Thread Colin King
From: Colin Ian King The pointer workload is dereferenced before it is null checked, hence there is a potential for a null pointer dereference on workload. Fix this by only dereferencing workload after it is null checked. Detected by CoverityScan, CID#1466017

[Intel-gfx] [PATCH] drm/i915/gvt: fix spelling mistake: "registeration" -> "registration"

2018-03-19 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in gvt_err error message text Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gvt/gvt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Intel-gfx] [PATCH][drm-next] drm/i915/gvt: fix spelling mistake: "destoried" -> "destroyed"

2018-03-12 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in gvt_err error message text. Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gvt/gtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Intel-gfx] [PATCH][next] drm/i915/pmu: fix sizeof on attr, should be *attr

2018-01-12 Thread Colin King
From: Colin Ian King I believe the sizeof(attr) should be in fact sizeof(*attr), fortunately the current code works because sizeof(struct attribute **) is the same as sizeof(struct attribute *) for x86. Detected by CoverityScan, CID#1463854 ("Sizeof not portable")

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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,

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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