diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-09-19 16:55:34 +0100 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2017-11-21 11:39:43 +0200 |
commit | dcd1d8302a06b0a0e5d6f9b6851fa4a5579e79b0 (patch) | |
tree | 97198d5f2aa431477d6aef0dd433e5cb4d3f602d /drivers/gpu/drm/i915 | |
parent | 294cf1af8cf2eb0d1eced377fdfb9a2d3f0e8b42 (diff) | |
download | lwn-dcd1d8302a06b0a0e5d6f9b6851fa4a5579e79b0.tar.gz lwn-dcd1d8302a06b0a0e5d6f9b6851fa4a5579e79b0.zip |
drm/i915/gvt: ensure -ve return value is handled correctly
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 compared against 0")
Fixes: 1e3197d6ad73 ("drm/i915/gvt: Refine error handling for perform_bb_shadow")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
(cherry picked from commit 24f8a29af4afe7c53e08f4afa0c3fa9eb3791b89)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/gvt/cmd_parser.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c index 701a3c6f1669..85d4c57870fb 100644 --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c @@ -1628,7 +1628,7 @@ static int perform_bb_shadow(struct parser_exec_state *s) struct intel_shadow_bb_entry *entry_obj; struct intel_vgpu *vgpu = s->vgpu; unsigned long gma = 0; - uint32_t bb_size; + int bb_size; void *dst = NULL; int ret = 0; |