Skip to content

Commit

Permalink
[ALSA] usbusx2yaudio: kfree(NULL) is valid
Browse files Browse the repository at this point in the history
if (!x) kfree(x); is not needed since kfree(NULL) is valid.

Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
  • Loading branch information
Richard Knutsson authored and Jaroslav Kysela committed Jul 20, 2007
1 parent 500bec3 commit c111b8d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sound/usb/usx2y/usbusx2yaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,10 +935,9 @@ static struct snd_pcm_ops snd_usX2Y_pcm_ops =
*/
static void usX2Y_audio_stream_free(struct snd_usX2Y_substream **usX2Y_substream)
{
if (NULL != usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK]) {
kfree(usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK]);
usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK] = NULL;
}
kfree(usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK]);
usX2Y_substream[SNDRV_PCM_STREAM_PLAYBACK] = NULL;

kfree(usX2Y_substream[SNDRV_PCM_STREAM_CAPTURE]);
usX2Y_substream[SNDRV_PCM_STREAM_CAPTURE] = NULL;
}
Expand Down

0 comments on commit c111b8d

Please sign in to comment.