Do not assume interface numbers follow the slice indices. (#134)
Do not assume interface numbers follow the slice indices.
This is a continuation of
9ad54830f4
which tried to solve the problem of non-contiguous interface indices;
this commit modifies another code path that had the same assumption.
This commit is contained in:

committed by
GitHub

parent
606016adee
commit
e840be9d06
@@ -276,9 +276,13 @@ func (d *Device) InterfaceDescription(cfgNum, intfNum, altNum int) (string, erro
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("%s: %v", d, err)
|
||||
}
|
||||
alt, err := cfg.intfDesc(intfNum, altNum)
|
||||
intf, err := cfg.intfDesc(intfNum)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("%s, configuration %d: %v", d, cfgNum, err)
|
||||
return "", fmt.Errorf("%s, configuration %d interface %d: %v", d, cfgNum, intfNum, err)
|
||||
}
|
||||
alt, err := intf.altSetting(altNum)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("%s, configuration %d interface %d alternate setting %d: %v", d, cfgNum, intfNum, altNum, err)
|
||||
}
|
||||
return d.GetStringDescriptor(alt.iInterface)
|
||||
}
|
||||
|
Reference in New Issue
Block a user