From: Xu Wang <vulab@iscas.ac.cn>
To: perex@perex.cz, tiwai@suse.com, alexander@tsoy.me,
e.burema@gmail.com, vulab@iscas.ac.cn, henryl@nvidia.com,
alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] usb: endpoint : remove needless check before usb_free_coherent()
Date: Mon, 27 Jul 2020 02:52:08 +0000 [thread overview]
Message-ID: <20200727025208.8739-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 | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 88760268fb55..3a2b2a309a71 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -615,9 +615,8 @@ static void release_urbs(struct snd_usb_endpoint *ep, int force)
for (i = 0; i < ep->nurbs; i++)
release_urb_ctx(&ep->urb[i]);
- if (ep->syncbuf)
- usb_free_coherent(ep->chip->dev, SYNC_URBS * 4,
- ep->syncbuf, ep->sync_dma);
+ usb_free_coherent(ep->chip->dev, SYNC_URBS * 4,
+ ep->syncbuf, ep->sync_dma);
ep->syncbuf = NULL;
ep->nurbs = 0;
--
2.17.1
next reply other threads:[~2020-07-27 2:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-27 2:52 Xu Wang [this message]
2020-07-27 16:40 ` [PATCH] usb: endpoint : remove needless 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=20200727025208.8739-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=henryl@nvidia.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).