File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ impl EnumerationInfo {
7878 } ;
7979
8080 let mut index = None ;
81+ let mut cfg_len = 0 ;
8182 for i in 0 ..self . device_desc . num_configurations {
8283 let cfg_desc_short = channel
8384 . request_descriptor :: < ConfigurationDescriptor , { ConfigurationDescriptor :: SIZE } > ( i, false )
@@ -88,6 +89,7 @@ impl EnumerationInfo {
8889 return Err ( HostError :: InsufficientMemory ) ;
8990 }
9091
92+ cfg_len = cfg_desc_short. total_len as usize ;
9193 index. replace ( i) ;
9294 break ;
9395 }
@@ -97,8 +99,10 @@ impl EnumerationInfo {
9799 "Active Configuration not found on device, bad device?" ,
98100 ) ) ?;
99101
102+ let dest_buffer = & mut cfg_desc_buf[ 0 ..cfg_len] ;
103+
100104 channel
101- . request_descriptor_bytes ( ConfigurationDescriptor :: DESC_TYPE , index, cfg_desc_buf )
105+ . request_descriptor_bytes ( ConfigurationDescriptor :: DESC_TYPE , index, dest_buffer )
102106 . await ?;
103107
104108 let cfg_desc =
You can’t perform that action at this time.
0 commit comments