mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	ALSA: sb8: add a check for request_region
In case request_region fails, the fix returns an error code to avoid NULL pointer dereference. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									6ade657d61
								
							
						
					
					
						commit
						dcd0feac9b
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -111,6 +111,10 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* block the 0x388 port to avoid PnP conflicts */
 | 
						/* block the 0x388 port to avoid PnP conflicts */
 | 
				
			||||||
	acard->fm_res = request_region(0x388, 4, "SoundBlaster FM");
 | 
						acard->fm_res = request_region(0x388, 4, "SoundBlaster FM");
 | 
				
			||||||
 | 
						if (!acard->fm_res) {
 | 
				
			||||||
 | 
							err = -EBUSY;
 | 
				
			||||||
 | 
							goto _err;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (port[dev] != SNDRV_AUTO_PORT) {
 | 
						if (port[dev] != SNDRV_AUTO_PORT) {
 | 
				
			||||||
		if ((err = snd_sbdsp_create(card, port[dev], irq[dev],
 | 
							if ((err = snd_sbdsp_create(card, port[dev], irq[dev],
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue