]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: SAUCE: arm64: arch_timer: Add check for unknown erratum
authordann frazier <dann.frazier@canonical.com>
Fri, 24 Mar 2017 19:53:05 +0000 (13:53 -0600)
committerTim Gardner <tim.gardner@canonical.com>
Tue, 28 Mar 2017 20:17:54 +0000 (14:17 -0600)
BugLink: https://bugs.launchpad.net/bugs/1675509
If an unknown erratum type is passed into arch_timer_check_ool_workaround(),
we would call arch_timer_iterate_errata with a NULL match_fn and trigger
an Oops. This does not look possible with the existing code (all types are
accounted for), but emit an error and return if it happens to come to pass
in the future.

Reported-by: Seth Forshee <seth.foreshee@canonical.com>
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/clocksource/arm_arch_timer.c

index 9a4feb574ef4ba0c79974005b7273a1b94759d31..d29098d70b688eb63c81e8f9600807b55539cad6 100644 (file)
@@ -504,6 +504,9 @@ static void arch_timer_check_ool_workaround(enum arch_timer_erratum_match_type t
        case ate_match_acpi_oem_info:
                match_fn = arch_timer_check_acpi_oem_erratum;
                break;
+       default:
+               pr_err("arch_timer: Unknown erratum workaround type specified.\n");
+               return;
        }
 
        wa = arch_timer_iterate_errata(type, match_fn, arg);