linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xu Wang <vulab@iscas.ac.cn>
To: perex@perex.cz, tiwai@suse.com, alexander@tsoy.me,
	e.burema@gmail.com, alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] ALSA: usb-audio: endpoint : remove redundant check before usb_free_coherent()
Date: Thu,  4 Feb 2021 02:05:18 +0000	[thread overview]
Message-ID: <20210204020518.76619-1-vulab@iscas.ac.cn> (raw)

usb_free_coherent() is safe with NULL addr and this check is
not required.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
 sound/usb/endpoint.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 8e568823c992..d5ed4ddfd451 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -82,10 +82,9 @@ static inline unsigned get_usb_high_speed_rate(unsigned int rate)
  */
 static void release_urb_ctx(struct snd_urb_ctx *u)
 {
-	if (u->buffer_size)
-		usb_free_coherent(u->ep->chip->dev, u->buffer_size,
-				  u->urb->transfer_buffer,
-				  u->urb->transfer_dma);
+	usb_free_coherent(u->ep->chip->dev, u->buffer_size,
+			  u->urb->transfer_buffer,
+			  u->urb->transfer_dma);
 	usb_free_urb(u->urb);
 	u->urb = NULL;
 }
-- 
2.17.1


             reply	other threads:[~2021-02-04  2:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04  2:05 Xu Wang [this message]
2021-02-04  6:40 ` [PATCH] ALSA: usb-audio: endpoint : remove redundant check before usb_free_coherent() Takashi Iwai

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=20210204020518.76619-1-vulab@iscas.ac.cn \
    --to=vulab@iscas.ac.cn \
    --cc=alexander@tsoy.me \
    --cc=alsa-devel@alsa-project.org \
    --cc=e.burema@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /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;
as well as URLs for NNTP newsgroup(s).