mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-04 12:07:12 +00:00 
			
		
		
		
	intel_error_decode: Don't barf on a malformed PCI ID line
Whoops, someone added UTS_RELEASE with no newline before PCI ID which upsets our naive parser.
This commit is contained in:
		
							parent
							
								
									34c66d0739
								
							
						
					
					
						commit
						f9c8e365e9
					
				@ -365,6 +365,11 @@ read_data_file (FILE *file)
 | 
			
		||||
	    matched = sscanf (line, "PCI ID: 0x%04x\n", ®);
 | 
			
		||||
	    if (matched == 0)
 | 
			
		||||
		    matched = sscanf (line, " PCI ID: 0x%04x\n", ®);
 | 
			
		||||
	    if (matched == 0) {
 | 
			
		||||
		    const char *pci_id_start = strstr (line, "PCI ID");
 | 
			
		||||
		    if (pci_id_start)
 | 
			
		||||
			    matched = sscanf (pci_id_start, "PCI ID: 0x%04x\n", ®);
 | 
			
		||||
	    }
 | 
			
		||||
	    if (matched == 1) {
 | 
			
		||||
		    devid = reg;
 | 
			
		||||
		    printf("Detected GEN%i chipset\n",
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user