diff options
author | Kangjie Lu <kjlu@umn.edu> | 2019-03-14 23:04:14 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-20 09:15:00 +0200 |
commit | b042245be24b0e663bcf45f0ae77910bb3f11829 (patch) | |
tree | 321f76ea1e9536ce919fdf0552fdde851a4365b3 /sound/isa | |
parent | 7d831a0512987fc2af6b3a23ed44a4e96b79f26a (diff) | |
download | linux-stable-b042245be24b0e663bcf45f0ae77910bb3f11829.tar.gz linux-stable-b042245be24b0e663bcf45f0ae77910bb3f11829.tar.bz2 linux-stable-b042245be24b0e663bcf45f0ae77910bb3f11829.zip |
ALSA: sb8: add a check for request_region
[ Upstream commit dcd0feac9bab901d5739de51b3f69840851f8919 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/isa')
-rw-r--r-- | sound/isa/sb/sb8.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c index d77dcba276b5..1eb8b61a185b 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], |