Author: cem
Date: Wed Apr 20 02:58:22 2016
New Revision: 298331
URL: https://svnweb.freebsd.org/changeset/base/298331

Log:
  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

Modified:
  head/sys/dev/drm2/i915/intel_pm.c

Modified: head/sys/dev/drm2/i915/intel_pm.c
==============================================================================
--- head/sys/dev/drm2/i915/intel_pm.c   Wed Apr 20 02:09:38 2016        
(r298330)
+++ head/sys/dev/drm2/i915/intel_pm.c   Wed Apr 20 02:58:22 2016        
(r298331)
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
 #include <dev/drm2/i915/i915_drv.h>
 #include <dev/drm2/i915/intel_drv.h>
 #include <sys/kdb.h>
+#include <machine/clock.h>
 
 #define FORCEWAKE_ACK_TIMEOUT_MS 2
 
@@ -2686,9 +2687,9 @@ static void gen6_update_ring_freq(struct
        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 */
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to