mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-04 05:50:17 +00:00 
			
		
		
		
	usb: Handle audio extension endpoint descriptor in usb_parse_config()
Normal endpoint descriptor size is 7, but for audio extension it is 9. Handle that correctly when parsing endpoint descriptor. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
		
							parent
							
								
									8a0e6d8307
								
							
						
					
					
						commit
						2f0eb2ac4b
					
				@ -437,12 +437,13 @@ static int usb_parse_config(struct usb_device *dev,
 | 
			
		||||
			}
 | 
			
		||||
			break;
 | 
			
		||||
		case USB_DT_ENDPOINT:
 | 
			
		||||
			if (head->bLength != USB_DT_ENDPOINT_SIZE) {
 | 
			
		||||
			if (head->bLength != USB_DT_ENDPOINT_SIZE &&
 | 
			
		||||
			    head->bLength != USB_DT_ENDPOINT_AUDIO_SIZE) {
 | 
			
		||||
				printf("ERROR: Invalid USB EP length (%d)\n",
 | 
			
		||||
					head->bLength);
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			if (index + USB_DT_ENDPOINT_SIZE >
 | 
			
		||||
			if (index + head->bLength >
 | 
			
		||||
			    dev->config.desc.wTotalLength) {
 | 
			
		||||
				puts("USB EP descriptor overflowed buffer!\n");
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user