mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][V3] drm/i915/guc: fix GEM_BUG_ON check
@ 2018-06-12  9:38 Colin King
  2018-06-12 12:08 ` [Intel-gfx] " Michal Wajdeczko
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-06-12  9:38 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	intel-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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 control default GuC logging")
Signed-off-by: Colin Ian King <colin.king@canonical.com>

---
V3: Make level s32 and add the missing Fixes: tag, thanks to Dan Carpenter and
Jani Nikula for correcting my mistakes

---
 drivers/gpu/drm/i915/intel_guc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_guc.c b/drivers/gpu/drm/i915/intel_guc.c
index 116f4ccf1bbd..bdb1fab322bf 100644
--- a/drivers/gpu/drm/i915/intel_guc.c
+++ b/drivers/gpu/drm/i915/intel_guc.c
@@ -205,7 +205,7 @@ void intel_guc_fini(struct intel_guc *guc)
 
 static u32 get_log_control_flags(void)
 {
-	u32 level = i915_modparams.guc_log_level;
+	s32 level = i915_modparams.guc_log_level;
 	u32 flags = 0;
 
 	GEM_BUG_ON(level < 0);
-- 
2.17.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-12 12:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12  9:38 [PATCH][V3] drm/i915/guc: fix GEM_BUG_ON check Colin King
2018-06-12 12:08 ` [Intel-gfx] " Michal Wajdeczko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®