diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-14 13:29:31 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-14 13:29:31 -0700 |
| commit | d985524680b77a1cf90738db9a2d72065a746afa (patch) | |
| tree | 101857c3e59f9238b0c7d4bbbf58e46476957387 /drivers/thunderbolt/eeprom.c | |
| parent | 2007eafd9df71375d443192bbbe7aa2175992477 (diff) | |
| parent | ef954844c7ace62f773f4f23e28d2d915adc419f (diff) | |
Merge 4.13-rc5 into char-misc-next
We want the firmware, and other changes, in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/thunderbolt/eeprom.c')
| -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, int res; enum tb_port_type type; + /* + * Some DROMs list more ports than the controller actually has + * so we skip those but allow the parser to continue. + */ + if (header->index > sw->config.max_port_number) { + dev_info_once(&sw->dev, "ignoring unnecessary extra entries in DROM\n"); + return 0; + } + port = &sw->ports[header->index]; port->disabled = header->port_disabled; if (port->disabled) |
