Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp723628ybg; Sun, 26 Jul 2020 19:53:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWmbJhiEyPDJ574NPY8cy3WOJxuRRWF0MwWCjTVpSRywy3tlBA65LAst0NUlzO+XEqyuA2 X-Received: by 2002:a17:906:16c8:: with SMTP id t8mr16477775ejd.484.1595818404283; Sun, 26 Jul 2020 19:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595818404; cv=none; d=google.com; s=arc-20160816; b=xDOW7DIc5xh0Zx2ygE3PPauMweQQaYPj/dVgri1Tk14R+/cI1Mb50l2CQJk87Rrzxo Y4khdkEtFtRekMvd/026oaAPHf7glMzartO+yKCZ0w4kfTsIOZFKoLMB4R4bcVS/c0Ro BsdWrUAtLRjYRVlvfbo/W3BYbayQrZtVMFia6iBrVm/jtdcxMwW9Z5QuDHhqHkC4FyLZ 2PT5ygLK4O8m0tu/9cY7PuCtzJ89RVXRJ9FNjj1ewiA+m47/L9ebFwbEq9xvorDL2i8H FV2Fi+90ghzfLQnnJUlCIvSIN3y0w/R9JaPyI07dGG+V09HvWf3vWLjqn9Qtcv2SvrsJ dVeQ== 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=lGNsVZDldWDYAiwbTTlzCQ8etlOpdkZZelBe58+6CeA=; b=hza2J66TsRWOyFWcsXtsWHKNfrp9bzZUhrhTR8cPCUeRMz749zF9A5gdZ823nDVH2h KEVdcM4wiwrJtGuacR7bUyD9c2fHhXGkkGCdPqODbl17mSxc+dIZAAvQC+a9q/aiYQhg U+NskT6pzbxuW+ZZrT/M0h9Xb4k2YuXzyzZf0JIWk1uIsAEkldhjXygs1Ol++2EZkABm /JiKbXP3qkE+5Zxs24tA3fYIf6C2KxWk1U2RuS+n1v4Pa1WiSnCzcbx1jHpJiAOsPGYZ jzBbOllsagMjeZAxI5JW80o5nn2vaXfEiKu+1Xyb8zvIeNXapz8kSMHLjib8CP0JpJe4 yWHQ== 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 a12si60499ejv.186.2020.07.26.19.53.01; Sun, 26 Jul 2020 19:53:24 -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 S1726890AbgG0Cw3 (ORCPT + 99 others); Sun, 26 Jul 2020 22:52:29 -0400 Received: from smtp23.cstnet.cn ([159.226.251.23]:60416 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726044AbgG0Cw3 (ORCPT ); Sun, 26 Jul 2020 22:52:29 -0400 Received: from localhost (unknown [159.226.5.99]) by APP-03 (Coremail) with SMTP id rQCowAAnL8NZQR5fRJpnAw--.64264S2; Mon, 27 Jul 2020 10:52:09 +0800 (CST) From: Xu Wang To: perex@perex.cz, tiwai@suse.com, alexander@tsoy.me, e.burema@gmail.com, vulab@iscas.ac.cn, henryl@nvidia.com, alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] usb: endpoint : remove needless check before usb_free_coherent() Date: Mon, 27 Jul 2020 02:52:08 +0000 Message-Id: <20200727025208.8739-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: rQCowAAnL8NZQR5fRJpnAw--.64264S2 X-Coremail-Antispam: 1UD129KBjvdXoWrKFWrZw4UGr47GFWDW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ACs8 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 addr and this check is not required. Signed-off-by: Xu Wang --- sound/usb/endpoint.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 88760268fb55..3a2b2a309a71 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -615,9 +615,8 @@ static void release_urbs(struct snd_usb_endpoint *ep, int force) for (i = 0; i < ep->nurbs; i++) release_urb_ctx(&ep->urb[i]); - if (ep->syncbuf) - usb_free_coherent(ep->chip->dev, SYNC_URBS * 4, - ep->syncbuf, ep->sync_dma); + usb_free_coherent(ep->chip->dev, SYNC_URBS * 4, + ep->syncbuf, ep->sync_dma); ep->syncbuf = NULL; ep->nurbs = 0; -- 2.17.1