From patchwork Mon Jul 20 05:24:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Wang X-Patchwork-Id: 11672865 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ACD2C13B6 for ; Mon, 20 Jul 2020 05:34:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 97FE42080D for ; Mon, 20 Jul 2020 05:34:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725815AbgGTFef (ORCPT ); Mon, 20 Jul 2020 01:34:35 -0400 Received: from smtp23.cstnet.cn ([159.226.251.23]:32928 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725287AbgGTFef (ORCPT ); Mon, 20 Jul 2020 01:34:35 -0400 X-Greylist: delayed 564 seconds by postgrey-1.27 at vger.kernel.org; Mon, 20 Jul 2020 01:34:34 EDT Received: from localhost (unknown [159.226.5.99]) by APP-03 (Coremail) with SMTP id rQCowABnbsKpKhVfVW3mAQ--.9162S2; Mon, 20 Jul 2020 13:24:57 +0800 (CST) From: Xu Wang To: gregkh@linuxfoundation.org, vulab@iscas.ac.cn, oneukum@suse.com, linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] usb: appledisplay: remove needless check before usb_free_coherent() Date: Mon, 20 Jul 2020 05:24:56 +0000 Message-Id: <20200720052456.7610-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: rQCowABnbsKpKhVfVW3mAQ--.9162S2 X-Coremail-Antispam: 1UD129KBjvdXoWrKFWrZw4UGr47GFWDJw48Crg_yoWfJwb_ur 1rCrn5Jr98A343Zr1Utr1fZr48ta4UXrn2q3Wxt3y3tFyq9FyUtw42yrWrArsxCFykJFWq yw1vgFZ8Kw4FvjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb4xFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVWxJr 0_GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jrv_JF1lYx0Ex4A2jsIE14v26r4UJVWxJr1lOx8S6xCaFVCjc4AY6r 1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCY02Avz4vE14v_ GrWl42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxV WUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI 7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r 1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v26r1j6r4U MIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUkwIDUUU UU= X-Originating-IP: [159.226.5.99] X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiAggDA1Jhbk13vAABsQ Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org usb_free_coherent() is safe with NULL addr and this check is not required. Signed-off-by: Xu Wang --- 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); }