diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2015-01-03 08:54:56 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-04 09:11:05 -0500 |
commit | 57dca36ee25bcab20a71705175c00b6f114cdab4 (patch) | |
tree | c3c6ee752a87305b99d0e6b4b5f03adc19aee41a /sound/core | |
parent | adc2ae0bb6daa2287d1a6567d18be01da546f7a7 (diff) |
ALSA: seq: Deletion of unnecessary checks before the function call "snd_midi_event_free"
The snd_midi_event_free() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/seq/oss/seq_oss_midi.c | 6 | ||||
-rw-r--r-- | sound/core/seq/seq_midi.c | 3 |
2 files changed, 3 insertions, 6 deletions
diff --git a/sound/core/seq/oss/seq_oss_midi.c b/sound/core/seq/oss/seq_oss_midi.c index 3a4569669efa..e79cc44b1394 100644 --- a/sound/core/seq/oss/seq_oss_midi.c +++ b/sound/core/seq/oss/seq_oss_midi.c | |||
@@ -237,8 +237,7 @@ snd_seq_oss_midi_check_exit_port(int client, int port) | |||
237 | spin_unlock_irqrestore(®ister_lock, flags); | 237 | spin_unlock_irqrestore(®ister_lock, flags); |
238 | snd_use_lock_free(&mdev->use_lock); | 238 | snd_use_lock_free(&mdev->use_lock); |
239 | snd_use_lock_sync(&mdev->use_lock); | 239 | snd_use_lock_sync(&mdev->use_lock); |
240 | if (mdev->coder) | 240 | snd_midi_event_free(mdev->coder); |
241 | snd_midi_event_free(mdev->coder); | ||
242 | kfree(mdev); | 241 | kfree(mdev); |
243 | } | 242 | } |
244 | spin_lock_irqsave(®ister_lock, flags); | 243 | spin_lock_irqsave(®ister_lock, flags); |
@@ -265,8 +264,7 @@ snd_seq_oss_midi_clear_all(void) | |||
265 | spin_lock_irqsave(®ister_lock, flags); | 264 | spin_lock_irqsave(®ister_lock, flags); |
266 | for (i = 0; i < max_midi_devs; i++) { | 265 | for (i = 0; i < max_midi_devs; i++) { |
267 | if ((mdev = midi_devs[i]) != NULL) { | 266 | if ((mdev = midi_devs[i]) != NULL) { |
268 | if (mdev->coder) | 267 | snd_midi_event_free(mdev->coder); |
269 | snd_midi_event_free(mdev->coder); | ||
270 | kfree(mdev); | 268 | kfree(mdev); |
271 | midi_devs[i] = NULL; | 269 | midi_devs[i] = NULL; |
272 | } | 270 | } |
diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c index a1fd77af6059..68fec776da26 100644 --- a/sound/core/seq/seq_midi.c +++ b/sound/core/seq/seq_midi.c | |||
@@ -268,8 +268,7 @@ static void snd_seq_midisynth_delete(struct seq_midisynth *msynth) | |||
268 | snd_seq_event_port_detach(msynth->seq_client, msynth->seq_port); | 268 | snd_seq_event_port_detach(msynth->seq_client, msynth->seq_port); |
269 | } | 269 | } |
270 | 270 | ||
271 | if (msynth->parser) | 271 | snd_midi_event_free(msynth->parser); |
272 | snd_midi_event_free(msynth->parser); | ||
273 | } | 272 | } |
274 | 273 | ||
275 | /* register new midi synth port */ | 274 | /* register new midi synth port */ |