usb: appledisplay: remove needless check before usb_free_coherent()
authorXu Wang <vulab@iscas.ac.cn>
Mon, 20 Jul 2020 05:24:56 +0000 (05:24 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Jul 2020 11:41:58 +0000 (13:41 +0200)
usb_free_coherent() is safe with NULL addr and this check is
not required.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Link: https://lore.kernel.org/r/20200720052456.7610-1-vulab@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/appledisplay.c

index 91cfd917f6df4c7566f9a17affd83b32cd1d3097..36fed1a0966633cfb226917c67aae1384ee204c5 100644 (file)
@@ -305,8 +305,7 @@ error:
                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);
                }