From 6401e5186765c41b3ce69b9a597471cf382d8de2 Mon Sep 17 00:00:00 2001 From: cem Date: Wed, 20 Apr 2016 02:58:22 +0000 Subject: [PATCH] i915kms intel_pm: Read from actual tsc_freq instead of uninitialized local The local of the same name would alias the global, but we didn't even include the header that defines tsc_freq. Include it and rename the local. Reported by: Coverity CID: 1331559 Sponsored by: EMC / Isilon Storage Division --- sys/dev/drm2/i915/intel_pm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/drm2/i915/intel_pm.c b/sys/dev/drm2/i915/intel_pm.c index ddab457a6585..143c92a97200 100644 --- a/sys/dev/drm2/i915/intel_pm.c +++ b/sys/dev/drm2/i915/intel_pm.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define FORCEWAKE_ACK_TIMEOUT_MS 2 @@ -2686,9 +2687,9 @@ static void gen6_update_ring_freq(struct drm_device *dev) if (!max_ia_freq) max_ia_freq = tsc_khz; #else - uint64_t tsc_freq; - tsc_freq = atomic_load_acq_64(&tsc_freq); - max_ia_freq = tsc_freq / 1000; + uint64_t freq; + freq = atomic_load_acq_64(&tsc_freq); + max_ia_freq = freq / 1000; #endif /* FREEBSD_WIP */ /* Convert from kHz to MHz */