Skip to content

Commit

Permalink
usb: appledisplay: remove needless check before usb_free_coherent()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xu Wang authored and Greg Kroah-Hartman committed Jul 21, 2020
1 parent ffeb1e9 commit d8a8493
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/misc/appledisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d8a8493

Please sign in to comment.