diff options
| -rw-r--r-- | drivers/thunderbolt/eeprom.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c index 308b6e17c88a..fe2f00ceafc5 100644 --- a/drivers/thunderbolt/eeprom.c +++ b/drivers/thunderbolt/eeprom.c | |||
| @@ -333,6 +333,15 @@ static int tb_drom_parse_entry_port(struct tb_switch *sw, | |||
| 333 | int res; | 333 | int res; |
| 334 | enum tb_port_type type; | 334 | enum tb_port_type type; |
| 335 | 335 | ||
| 336 | /* | ||
| 337 | * Some DROMs list more ports than the controller actually has | ||
| 338 | * so we skip those but allow the parser to continue. | ||
| 339 | */ | ||
| 340 | if (header->index > sw->config.max_port_number) { | ||
| 341 | dev_info_once(&sw->dev, "ignoring unnecessary extra entries in DROM\n"); | ||
| 342 | return 0; | ||
| 343 | } | ||
| 344 | |||
| 336 | port = &sw->ports[header->index]; | 345 | port = &sw->ports[header->index]; |
| 337 | port->disabled = header->port_disabled; | 346 | port->disabled = header->port_disabled; |
| 338 | if (port->disabled) | 347 | if (port->disabled) |
