Skip to content

Commit 24f8a29

Browse files
Colin Ian Kingzhenyw
Colin Ian King
authored andcommitted
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: 1e3197d ("drm/i915/gvt: Refine error handling for perform_bb_shadow") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Zhenyu Wang <[email protected]>
1 parent c921400 commit 24f8a29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/gvt/cmd_parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,7 @@ static int perform_bb_shadow(struct parser_exec_state *s)
16501650
struct intel_shadow_bb_entry *entry_obj;
16511651
struct intel_vgpu *vgpu = s->vgpu;
16521652
unsigned long gma = 0;
1653-
uint32_t bb_size;
1653+
int bb_size;
16541654
void *dst = NULL;
16551655
int ret = 0;
16561656

0 commit comments

Comments
 (0)