summaryrefslogtreecommitdiffstats
path: root/sound/isa/sb
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2019-03-15 05:04:14 +0100
committerTakashi Iwai <tiwai@suse.de>2019-03-16 10:30:27 +0100
commitdcd0feac9bab901d5739de51b3f69840851f8919 (patch)
treee1bc92dec112b1add9d62e0e47c7ddba048af90b /sound/isa/sb
parentALSA: echoaudio: add a check for ioremap_nocache (diff)
downloadlinux-dcd0feac9bab901d5739de51b3f69840851f8919.tar.xz
linux-dcd0feac9bab901d5739de51b3f69840851f8919.zip
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>
Diffstat (limited to 'sound/isa/sb')
-rw-r--r--sound/isa/sb/sb8.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index aa2a83eb81a9..dc27a480c2d9 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -111,6 +111,10 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
/* block the 0x388 port to avoid PnP conflicts */
acard->fm_res = request_region(0x388, 4, "SoundBlaster FM");
+ if (!acard->fm_res) {
+ err = -EBUSY;
+ goto _err;
+ }
if (port[dev] != SNDRV_AUTO_PORT) {
if ((err = snd_sbdsp_create(card, port[dev], irq[dev],