From: Takashi Iwai <tiwai@suse.de>
To: Richard Knutsson <ricknu-0@student.ltu.se>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usbusx2yaudio: kfree(NULL) is valid
Date: Mon, 14 May 2007 11:33:58 +0200 [thread overview]
Message-ID: <s5hbqgnhhq1.wl%tiwai@suse.de> (raw)
In-Reply-To: <20070512183154.17375.54599.sendpatchset@thinktank.campus.ltu.se>
At Sat, 12 May 2007 20:29:20 +0200 (MEST),
Richard Knutsson wrote:
>
> if (!x) kfree(x); is not needed since kfree(NULL) is valid.
>
> Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
> ---
> Compile-tested with all(yes|mod|no)config on x86(|_64) & sparc(|64)
> Diffed against Linus' git-tree.
Thanks, merged to ALSA tree now.
Takashi
>
>
> diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
> index 0a352e4..48e9aa3 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;
> }
>
prev parent reply other threads:[~2007-05-14 9:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-12 18:29 Richard Knutsson
2007-05-14 9:33 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hbqgnhhq1.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=ricknu-0@student.ltu.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®