2020-07-20 05:30:31

by Xu Wang

[permalink] [raw]
Subject: [PATCH] usb: appledisplay: remove needless check before usb_free_coherent()

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

Signed-off-by: Xu Wang <[email protected]>
---
drivers/usb/misc/appledisplay.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
index ba1eaabc7796..eab3ea7e21cc 100644
--- a/drivers/usb/misc/appledisplay.c
+++ b/drivers/usb/misc/appledisplay.c
@@ -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);
}
--
2.17.1