diff options
| author | Thorsten Blum <thorsten.blum@linux.dev> | 2026-02-28 09:51:36 +0100 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-03-27 21:19:35 -0700 |
| commit | c02474fe1a62bb20548abd37b1d492a43a8b906e (patch) | |
| tree | c7429e9898f15b1bc6add71b660e6865e3dd0bcc /kernel/crash_dump_dm_crypt.c | |
| parent | 380369ea2e9d3c41855b0d8c41898dcd564209fd (diff) | |
crash_dump: remove redundant less-than-zero check
'key_count' is an 'unsigned int' and cannot be less than zero. Remove
the redundant condition.
Link: https://lkml.kernel.org/r/20260228085136.861971-2-thorsten.blum@linux.dev
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Baoquan He <bhe@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'kernel/crash_dump_dm_crypt.c')
| -rw-r--r-- | kernel/crash_dump_dm_crypt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/crash_dump_dm_crypt.c b/kernel/crash_dump_dm_crypt.c index a20d4097744a..5ce958d069dd 100644 --- a/kernel/crash_dump_dm_crypt.c +++ b/kernel/crash_dump_dm_crypt.c @@ -115,7 +115,7 @@ static int restore_dm_crypt_keys_to_thread_keyring(void) addr = dm_crypt_keys_addr; dm_crypt_keys_read((char *)&key_count, sizeof(key_count), &addr); - if (key_count < 0 || key_count > KEY_NUM_MAX) { + if (key_count > KEY_NUM_MAX) { kexec_dprintk("Failed to read the number of dm-crypt keys\n"); return -1; } |
