Skip to contentSkip to conversation

usb: appledisplay: remove needless check before usb_free_coherent()

PATCH New Xu Wang 1 participant 1 message Jul 20, 2020 USB

lore
Share & tools
lore

Xu Wang

author
#0 lore raw

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

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

---
 drivers/usb/misc/appledisplay.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/misc/appledisplay.c +1 -2
index ba1eaabc7796..eab3ea7e21cc 100644
@@ -305,8 +305,7 @@ static int appledisplay_probe(struct usb_interface *iface,
 		if (pdata->urb) {
 			usb_kill_urb(pdata->urb);
 			cancel_delayed_work_sync(&pdata->work);
-			if (pdata->urbdata)
-				usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
+			usb_free_coherent(pdata->udev, ACD_URB_BUFFER_LEN,
 					pdata->urbdata, pdata->urb->transfer_dma);
 			usb_free_urb(pdata->urb);
 		}
Signature · 1 line
2.17.1