[PATCH] [UBUNTU:sound/isa/sb/] Fix potential NULL pointer dereference in sb8_midi.c::snd_sb8dsp_midi_interrupt()

crimsun at fungus.sh.nu crimsun at fungus.sh.nu
Thu Jun 15 20:48:59 UTC 2006


Subject: [PATCH] [UBUNTU:sound/isa/sb/] Fix potential NULL pointer dereference in sb8_midi.c::snd_sb8dsp_midi_interrupt()

UpstreamStatus: Added in upstream alsa-kernel hg changeset ca292393434e
                http://hg-mirror.alsa-project.org/alsa-kernel?cmd=changeset;node=ca292393434eefefb7b37fa62d3fff170a964e4a;style=raw

Patch from Jesper Juhl <jesper.juhl at gmail.com> fixing Coverity #367. We
obviously don't want to dereference a pointer that was just tested for
NULL.

Signed-off-by: Daniel T Chen <crimsun at ubuntu.com>

---

 sound/isa/sb/sb8_midi.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

7fe791c0b0d258551417ec50577fff7475e70dcc
diff --git a/sound/isa/sb/sb8_midi.c b/sound/isa/sb/sb8_midi.c
index d2c633a..6b3dfb1 100644
--- a/sound/isa/sb/sb8_midi.c
+++ b/sound/isa/sb/sb8_midi.c
@@ -42,7 +42,10 @@ irqreturn_t snd_sb8dsp_midi_interrupt(sb
 	int max = 64;
 	char byte;
 
-	if (chip == NULL || (rmidi = chip->rmidi) == NULL) {
+	if (!chip)
+		return IRQ_NONE;
+	rmidi = chip->rmidi;
+	if (!rmidi) {
 		inb(SBP(chip, DATA_AVAIL));	/* ack interrupt */
 		return IRQ_NONE;
 	}
-- 
1.1.3


-- 
Daniel T. Chen            crimsun at ubuntu.com
GPG key:   www.sh.nu/~crimsun/pubkey.gpg.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20060615/fb41757f/attachment.pgp>


More information about the kernel-team mailing list