Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Thorsten Blum and committed by
Andrew Morton
c02474fe 380369ea

+1 -1
+1 -1
kernel/crash_dump_dm_crypt.c
··· 115 115 116 116 addr = dm_crypt_keys_addr; 117 117 dm_crypt_keys_read((char *)&key_count, sizeof(key_count), &addr); 118 - if (key_count < 0 || key_count > KEY_NUM_MAX) { 118 + if (key_count > KEY_NUM_MAX) { 119 119 kexec_dprintk("Failed to read the number of dm-crypt keys\n"); 120 120 return -1; 121 121 }