Skip to content

Commit dcd0fea

Browse files
kengitertiwai
authored andcommitted
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 <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 6ade657 commit dcd0fea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sound/isa/sb/sb8.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
111111

112112
/* block the 0x388 port to avoid PnP conflicts */
113113
acard->fm_res = request_region(0x388, 4, "SoundBlaster FM");
114+
if (!acard->fm_res) {
115+
err = -EBUSY;
116+
goto _err;
117+
}
114118

115119
if (port[dev] != SNDRV_AUTO_PORT) {
116120
if ((err = snd_sbdsp_create(card, port[dev], irq[dev],

0 commit comments

Comments
 (0)