Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp737809ybh; Sun, 12 Jul 2020 22:55:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHBhF60pXwE8NOd3nqQ4B51woeQmgnaXVTuRqp9f3tSPBSm+CzAE+pukLAWixYGcPfRLvZ X-Received: by 2002:a17:906:f53:: with SMTP id h19mr69979358ejj.491.1594619725370; Sun, 12 Jul 2020 22:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594619725; cv=none; d=google.com; s=arc-20160816; b=Tm8s4Xum7GoXQyA9wgChuxssjQ/F7M448Z45iqOySGiycjzRiO0KwdSl2O5roFIywF k990Q++HmPje2x3Z+HIqtGuf1wyP1+34pCIRpksDshCX1aKL9JndkQH/LFsRATfvII5r e6p1iSkYWfxOd3npRjvhD/RaE8v5IZdk1NhhKIidrGn0wqyjM8yRRy2l+BOONA47yeTd YXniHyj5p3W5mnX+CowtaPJUMQV9y/4gPh/aT/ayntqG4fwADSUXt77KxwUGq76KazTN 5YKw4pEQwayCjEgnk6SWtnw+gfzoUvi28iczap/DZHpCuFBBGTDh9l3jX8ZguXfp6WUW aDVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=dNppkY4xYNzlYycV0DAH2uvR2iQFlP6GMcejgUSU6tI=; b=FNR58LM+mrzMQJ4wMIUPt4Z12v6lDIgBDlig4Bs/Uz7LC8h0ovZ4Yu1gTULmDW5GW1 RShywwkOgNAdAbzpPmmGqM6uQT2aefsFcFC0R0pE1FRY4hmVR1I+vXPOcrwrsxd1hU8m CrzcTcVoDTDQSiCzb1pumqrwexuAd1czLES5zA+P/JQQ30ViNQfx1l3u+SFaekjo1Lpf Dt5xfQY5mT4Cop/GIArIjF/21T1a8JloOJxSioTWR8uSvsx+8FWt2SiVsyNWufC/0AVp 7UueQxp/JG+YTdW9zaRm3wi4FuOj1KImXEU7Bh40U2vu8c2KqYztHMf/lh4ISzzGcT6W wzxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si7830038ejc.99.2020.07.12.22.55.03; Sun, 12 Jul 2020 22:55:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728463AbgGMFyF (ORCPT + 99 others); Mon, 13 Jul 2020 01:54:05 -0400 Received: from smtp25.cstnet.cn ([159.226.251.25]:35092 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725818AbgGMFyF (ORCPT ); Mon, 13 Jul 2020 01:54:05 -0400 Received: from localhost (unknown [159.226.5.99]) by APP-05 (Coremail) with SMTP id zQCowABXng7v9gtffydiAA--.31846S2; Mon, 13 Jul 2020 13:53:51 +0800 (CST) From: Xu Wang To: wim@linux-watchdog.org, linux@roeck-us.net, linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Xu Wang Subject: [PATCH] watchdog: pcwd_usb: remove needless check before usb_free_coherent() Date: Mon, 13 Jul 2020 05:53:48 +0000 Message-Id: <20200713055348.21620-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: zQCowABXng7v9gtffydiAA--.31846S2 X-Coremail-Antispam: 1UD129KBjvdXoWrZw4rtr4rZr45AF15Aw1UZFb_yoWfuFc_Jr y0qrZ3GrnxCr1SgFy8Zw13AFWqgr48XFn3Wr4ftFyrCFZrtw1Yyr4xArWfCr4fAa95J3y7 Gr1vqrWFkr18GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbcAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s 0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xII jxv20xvE14v26r1Y6r17McIj6I8E87Iv67AKxVW8Jr0_Cr1UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc2xSY4AK67AK6r4r MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr 0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0E wIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJV W8JwCI42IY6xAIw20EY4v20xvaj40_WFyUJVCq3wCI42IY6I8E87Iv67AKxVWUJVW8JwCI 42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjfUY1v3UUUUU X-Originating-IP: [159.226.5.99] X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiCAAQA18J9e7lagAAsZ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org usb_free_coherent() is safe with NULL usb_pcwd->intr_buffer and this check is not required. Signed-off-by: Xu Wang --- drivers/watchdog/pcwd_usb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c index 2f44af1831d0..6726301ac02e 100644 --- a/drivers/watchdog/pcwd_usb.c +++ b/drivers/watchdog/pcwd_usb.c @@ -585,9 +585,8 @@ static struct notifier_block usb_pcwd_notifier = { static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd) { usb_free_urb(usb_pcwd->intr_urb); - if (usb_pcwd->intr_buffer != NULL) - usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size, - usb_pcwd->intr_buffer, usb_pcwd->intr_dma); + usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size, + usb_pcwd->intr_buffer, usb_pcwd->intr_dma); kfree(usb_pcwd); } -- 2.17.1