aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/emu10k1
diff options
context:
space:
mode:
authorJesper Juhl <juhl-lkml@dif.dk>2005-06-25 17:58:49 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 19:25:00 -0400
commit09417379be9b126e10ae7dcd7afc20b666146266 (patch)
tree0236f4cb1afb4cf9a7f13b67e6ac639c55fa0440 /sound/oss/emu10k1
parent4ae6673e029d609da7ef4311440d6de501d6967a (diff)
[PATCH] remove redundant NULL checks before kfree() in sound/ and avoid casting pointers about to be kfree()'ed
Checking a pointer for NULL before calling kfree() on it is redundant, kfree() deals with NULL pointers just fine. This patch removes such checks from sound/ This patch also makes another, but closely related, change. It avoids casting pointers about to be kfree()'ed. Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound/oss/emu10k1')
-rw-r--r--sound/oss/emu10k1/midi.c6
-rw-r--r--sound/oss/emu10k1/passthrough.c3
2 files changed, 3 insertions, 6 deletions
diff --git a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c
index 33dea3d56c1e..b40b5f97aace 100644
--- a/sound/oss/emu10k1/midi.c
+++ b/sound/oss/emu10k1/midi.c
@@ -523,10 +523,8 @@ void emu10k1_seq_midi_close(int dev)
523 card = midi_devs[dev]->devc; 523 card = midi_devs[dev]->devc;
524 emu10k1_mpuout_close(card); 524 emu10k1_mpuout_close(card);
525 525
526 if (card->seq_mididev) { 526 kfree(card->seq_mididev);
527 kfree(card->seq_mididev); 527 card->seq_mididev = NULL;
528 card->seq_mididev = NULL;
529 }
530} 528}
531 529
532int emu10k1_seq_midi_out(int dev, unsigned char midi_byte) 530int emu10k1_seq_midi_out(int dev, unsigned char midi_byte)
diff --git a/sound/oss/emu10k1/passthrough.c b/sound/oss/emu10k1/passthrough.c
index 4094be55f3be..4e3baca7d41f 100644
--- a/sound/oss/emu10k1/passthrough.c
+++ b/sound/oss/emu10k1/passthrough.c
@@ -213,8 +213,7 @@ void emu10k1_pt_stop(struct emu10k1_card *card)
213 sblive_writeptr(card, SPCS0 + i, 0, pt->old_spcs[i]); 213 sblive_writeptr(card, SPCS0 + i, 0, pt->old_spcs[i]);
214 } 214 }
215 pt->state = PT_STATE_INACTIVE; 215 pt->state = PT_STATE_INACTIVE;
216 if(pt->buf) 216 kfree(pt->buf);
217 kfree(pt->buf);
218 } 217 }
219} 218}
220 219