[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210204020518.76619-1-vulab@iscas.ac.cn>
Date: Thu, 4 Feb 2021 02:05:18 +0000
From: Xu Wang <vulab@...as.ac.cn>
To: perex@...ex.cz, tiwai@...e.com, alexander@...y.me,
e.burema@...il.com, alsa-devel@...a-project.org
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] ALSA: usb-audio: endpoint : remove redundant check before usb_free_coherent()
usb_free_coherent() is safe with NULL addr and this check is
not required.
Signed-off-by: Xu Wang <vulab@...as.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
Powered by blists - more mailing lists