summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2019-03-14 23:04:14 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-27 09:33:56 +0200
commit0a2741cd5269d8d5cd34898086e543b75bb18002 (patch)
tree4e1287c0d6b3a78f18f11a5c8473e2c59e45f2fd /sound
parent574469ec6dcfc25c5ae8149fb93cb3dede55ba57 (diff)
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')
-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 b8e2391c33ff..0c7fe1418447 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],