提交 182d3f84 编写于 作者: V Vincent Stehlé 提交者: Martin K. Petersen

scsi: fcoe: fix off by one in eth2fc_speed()

This should be "< ARRAY_SIZE()" instead of "<= ARRAY_SIZE()".

Fixes: 0b924e55 ("scsi: fcoe: provide translation table between Ethernet and FC port speeds")
Signed-off-by: NVincent Stehlé <vincent.stehle@laposte.net>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 92efbb85
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册