Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp790277pxb; Wed, 3 Feb 2021 18:56:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKjtL8W7RhFIqMwdsAZMr+tNbQC1qXD1eV7w+WXkfEyR+oDGEVRf3eYobTWhHLabBhEyJQ X-Received: by 2002:a05:6402:524f:: with SMTP id t15mr6049318edd.158.1612407406290; Wed, 03 Feb 2021 18:56:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612407406; cv=none; d=google.com; s=arc-20160816; b=GofJz++AOSuGWwrfUtYWW2hw8W0zTGEo+sJJJNkbPb8BJiDV96dOkOmmO681m6Hozl OerCsv5xmotoq/vxXSWRb8ESsMEX5I9/RlNMG3x43NlG1Wig7AEILFDyJ7IZwbmWJFAS 2HZZ72PcayC/zWTdZkij7nL7y8Ak9nHRREPzjinhodvlD9B1S0qnBMBnmfEH2FHJihe2 EqAjX/ZBfbyJ4N3qhEUeVAbpjwivB/DEsfUbBVdKtY4VJD/jpo3RQZ6osTl+7ThQ/PVx YeJ74WyyNvLxYlsiHu5uxkjcplmWB3Jp3IoUkKwtgyRL1UvO0ddb7wckv9i8+xdVF6TM Ep9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=f4yXAiHKD53E67LwEKdOg5d3LGzehaJHc8WeeOiMxH8=; b=ta+d3RGqbYgRqcJWzWTaH4wzjkWdelA/2vFqOLimuFTCTYLPPKXoZ+Rfm5k0/npfGa lL87IYfHt0RGe3H2YrdUoVrIZdsfFn+FhOMdieeYYAYXioJduKAV0ZHHP0Wt/wuAvzRq X4j3VH1H4269SzqVtTFhJBxecDbAA99z/0agnsNs37TynMhZ0o+Af0fEjjHhvmTvnKZA 3vidVt9Kmx7jRgTyyA7+T1HMyLaBObae9EgfERGw4NuitHYg4iU1Fxby4CIGLsMzT0+f BrX3wqUpDpI0RuDD3tT9q8uvwfJN5bJI/OGUJp7DmlYmTz9u8T32XyeT+cj4to3duVfO DsgQ== 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 f11si2625158edd.393.2021.02.03.18.56.21; Wed, 03 Feb 2021 18:56:46 -0800 (PST) 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 S234600AbhBDCGe (ORCPT + 99 others); Wed, 3 Feb 2021 21:06:34 -0500 Received: from smtp23.cstnet.cn ([159.226.251.23]:37756 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232411AbhBDCGW (ORCPT ); Wed, 3 Feb 2021 21:06:22 -0500 Received: from localhost.localdomain (unknown [124.16.141.241]) by APP-03 (Coremail) with SMTP id rQCowADHZrhhVhtg3RA3AQ--.39496S2; Thu, 04 Feb 2021 10:05:21 +0800 (CST) From: Xu Wang To: perex@perex.cz, tiwai@suse.com, alexander@tsoy.me, e.burema@gmail.com, alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] ALSA: usb-audio: endpoint : remove redundant check before usb_free_coherent() Date: Thu, 4 Feb 2021 02:05:18 +0000 Message-Id: <20210204020518.76619-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: rQCowADHZrhhVhtg3RA3AQ--.39496S2 X-Coremail-Antispam: 1UD129KBjvdXoWrKFWrZw4UGr47GFWDWF4UJwb_yoW3Kwb_Za ykCr4kWry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AAsI 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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 8e568823c992..d5ed4ddfd451 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -82,10 +82,9 @@ static inline unsigned get_usb_high_speed_rate(unsigned int rate) */ static void release_urb_ctx(struct snd_urb_ctx *u) { - if (u->buffer_size) - usb_free_coherent(u->ep->chip->dev, u->buffer_size, - u->urb->transfer_buffer, - u->urb->transfer_dma); + usb_free_coherent(u->ep->chip->dev, u->buffer_size, + u->urb->transfer_buffer, + u->urb->transfer_dma); usb_free_urb(u->urb); u->urb = NULL; } -- 2.17.1