summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2023-08-22 12:51:09 -0400
committerDamjan Marion <dmarion@0xa5.net>2023-09-13 12:14:18 +0000
commit63335e4898868113ede66fdc186c9585e51178c4 (patch)
treefe2d15fbe01cbce25efab18ceb2451c33329c0f5 /src/vlib
parent7a726586655854773e7e9f816508e139ea3e0477 (diff)
pci: fix coverity issue CID-322372
Type: fix Change-Id: Iaf16bb720d76ea3ae04afb8123b7cac15771ef2b Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/pci/pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vlib/pci/pci.c b/src/vlib/pci/pci.c
index dc4f382140e..1845a6211f5 100644
--- a/src/vlib/pci/pci.c
+++ b/src/vlib/pci/pci.c
@@ -302,7 +302,7 @@ _vlib_pci_link_speed (u8 *s, u8 speed, u8 width)
[1] = "2.5", [2] = "5.0", [3] = "8.0", [4] = "16.0", [5] = "32.0"
};
- if (speed > ARRAY_LEN (speeds) || speeds[speed] == 0)
+ if (speed >= ARRAY_LEN (speeds) || speeds[speed] == 0)
s = format (s, "unknown speed");
else
s = format (s, "%s GT/s", speeds[speed]);