mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-22 03:04:34 +01:00
nvmecontrol: Fix a sign compare mismatch
Even though mqes (uint16_t) and queue_size (u_int) are both unsigned, the expression 'mqes + 1' gets promoted to int which is signed. Keep the value unsigned by explicitly promoting mqes to u_int before incrementing the value. Reported by: GCC
This commit is contained in:
parent
766c4ad385
commit
c8703409ed
@ -452,8 +452,8 @@ connect_nvm_queues(const struct nvmf_association_params *aparams,
|
||||
|
||||
/* Validate I/O queue size. */
|
||||
if (queue_size == 0)
|
||||
queue_size = mqes + 1;
|
||||
else if (queue_size > mqes + 1) {
|
||||
queue_size = (u_int)mqes + 1;
|
||||
else if (queue_size > (u_int)mqes + 1) {
|
||||
shutdown_controller(*admin);
|
||||
nvmf_free_association(na);
|
||||
warn("I/O queue size exceeds controller maximum (%u)",
|
||||
|
Loading…
Reference in New Issue
Block a user