From: Richard Knutsson <ricknu-0@student.ltu.se>
Date: Mon, 14 May 2007 08:38:57 +0000 (+0200)
Subject: [ALSA] usbusx2yaudio: kfree(NULL) is valid
X-Git-Tag: firefly_0821_release~27411^2~99
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c111b8de975a357ff58e73047e9af48afacf2347;p=firefly-linux-kernel-4.4.55.git

[ALSA] usbusx2yaudio: kfree(NULL) is valid

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>
---

diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
index 0a352e46862f..48e9aa3f18c9 100644
--- a/sound/usb/usx2y/usbusx2yaudio.c
+++ b/sound/usb/usx2y/usbusx2yaudio.c
@@ -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;
 }