summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2023-04-19 10:58:43 +0300
committerWill Deacon <will@kernel.org>2023-04-20 10:44:54 +0100
commit460e70e2dc9af3128f69e533daf349635c421b0a (patch)
tree262b433bc1d0735a1237c347698a44bc571c308f /arch
parenta2a83eb40fbdeee3ed9c6fcc7bb015a2dd1a3e93 (diff)
arm64: delete dead code in this_cpu_set_vectors()
The "slot" variable is an enum, and in this context it is an unsigned int. So the type means it can never be negative and also we never pass invalid data to this function. If something did pass invalid data then this check would be insufficient protection. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/73859c9e-dea0-4764-bf01-7ae694fa2e37@kili.mountain Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/kernel/proton-pack.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/arch/arm64/kernel/proton-pack.c b/arch/arm64/kernel/proton-pack.c
index fca9cc6f5581..05f40c4e18fd 100644
--- a/arch/arm64/kernel/proton-pack.c
+++ b/arch/arm64/kernel/proton-pack.c
@@ -966,9 +966,6 @@ static void this_cpu_set_vectors(enum arm64_bp_harden_el1_vectors slot)
{
const char *v = arm64_get_bp_hardening_vector(slot);
- if (slot < 0)
- return;
-
__this_cpu_write(this_cpu_vector, v);
/*