From: Eugeni Dodonov Date: Thu, 10 Nov 2011 15:55:15 +0000 (-0200) Subject: drm/i915: prevent division by zero when asking for chipset power X-Git-Tag: v3.2-rc6~5^2~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ed0b577457eb6aeb7cdc7e7316576e63d15abb2;p=pandora-kernel.git drm/i915: prevent division by zero when asking for chipset power This prevents an in-kernel division by zero which happens when we are asking for i915_chipset_val too quickly, or within a race condition between the power monitoring thread and userspace accesses via debugfs. The issue can be reproduced easily via the following command: while ``; do cat /sys/kernel/debug/dri/0/i915_emon_status; done This is particularly dangerous because it can be triggered by a non-privileged user by just reading the debugfs entry. This issue was also found independently by Konstantin Belousov , who proposed a similar patch. Reported-by: Konstantin Belousov Acked-by: Jesse Barnes Acked-by: Keith Packard Reviewed-by: Chris Wilson Cc: Signed-off-by: Eugeni Dodonov Signed-off-by: Keith Packard --- Reading git-diff-tree failed