diff options
| author | Vincent Stehlé <[email protected]> | 2016-09-21 22:54:07 +0200 |
|---|---|---|
| committer | Martin K. Petersen <[email protected]> | 2016-09-26 20:54:45 -0400 |
| commit | 182d3f84307263e016977eaf23f9048483cf5ea2 (patch) | |
| tree | fe4d318ec0c0706ec028611c385d95885d6fc398 | |
| parent | 92efbb8500230c883ca6966b0ef9f3e18c1e29ba (diff) | |
scsi: fcoe: fix off by one in eth2fc_speed()
This should be "< ARRAY_SIZE()" instead of "<= ARRAY_SIZE()".
Fixes: 0b924e5505a568e7 ("scsi: fcoe: provide translation table between Ethernet and FC port speeds")
Signed-off-by: Vincent Stehlé <[email protected]>
Cc: Johannes Thumshirn <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
| -rw-r--r-- | drivers/scsi/fcoe/fcoe_transport.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c index c164eec54308..375c536cbc68 100644 --- a/drivers/scsi/fcoe/fcoe_transport.c +++ b/drivers/scsi/fcoe/fcoe_transport.c @@ -110,7 +110,7 @@ static inline u32 eth2fc_speed(u32 eth_port_speed) { int i; - for (i = 0; i <= ARRAY_SIZE(fcoe_port_speed_mapping); i++) { + for (i = 0; i < ARRAY_SIZE(fcoe_port_speed_mapping); i++) { if (fcoe_port_speed_mapping[i].eth_port_speed == eth_port_speed) return fcoe_port_speed_mapping[i].fc_port_speed; } |