Skip to content

Commit

Permalink
scsi: fcoe: fix off by one in eth2fc_speed()
Browse files Browse the repository at this point in the history
This should be "< ARRAY_SIZE()" instead of "<= ARRAY_SIZE()".

Fixes: 0b924e5 ("scsi: fcoe: provide translation table between Ethernet and FC port speeds")
Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Vincent Stehlé authored and Martin K. Petersen committed Sep 27, 2016
1 parent 92efbb8 commit 182d3f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/fcoe/fcoe_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 182d3f8

Please sign in to comment.