]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/time.c
[POWERPC] Fix possible division by zero in scaled time accounting
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / time.c
index c0d77723ba1141124733e05ab64b93343957a7fe..a925a8eae121e1946c8d39959775b4b07de1c561 100644 (file)
@@ -241,8 +241,9 @@ void account_system_vtime(struct task_struct *tsk)
                /* deltascaled includes both user and system time.
                 * Hence scale it based on the purr ratio to estimate
                 * the system time */
-               deltascaled = deltascaled * get_paca()->system_time /
-                       (get_paca()->system_time + get_paca()->user_time);
+               if (get_paca()->user_time)
+                       deltascaled = deltascaled * get_paca()->system_time /
+                            (get_paca()->system_time + get_paca()->user_time);
                delta += get_paca()->system_time;
                get_paca()->system_time = 0;
        }