Skip to contentSkip to conversation

usb: endpoint : remove needless check before usb_free_coherent()

PATCH Applied Xu Wang 2 participants 2 messages Jul 27, 2020 Sound

lore
Share & tools
lore

Xu Wang

author
#0 lore raw

PATCH 1/1 usb: endpoint : remove needless check before usb_free_coherent()

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

---
 sound/usb/endpoint.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
sound/usb/endpoint.c +2 -3
index 88760268fb55..3a2b2a309a71 100644
@@ -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;
Signature · 1 line
2.17.1