Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9174343pxu; Mon, 28 Dec 2020 08:25:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyln4f5pq9E5ZuVXGdAwDQ5MVb0/YrMhX+lpc1rJLWUM7LioVipkL7xzLjelFowM+9zo8ex X-Received: by 2002:a17:906:705:: with SMTP id y5mr40846831ejb.428.1609172726392; Mon, 28 Dec 2020 08:25:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609172726; cv=none; d=google.com; s=arc-20160816; b=m45ARYJQ/HSm4Y+2frjCR+R1Z4kvzy4HKfN2aocNpLPWgkPQHwpdTuKHCRZoCL9nAs s2OEPF2CTdzPpid5895rpKR+XCDH0icdII8PWUK9Y2z4Lp1lqrDito3yIxsl4+/dZG6X ln6u60KgzoLwrIe3Ci6ARl2pbkqU6OJNd8dn85j9nFKs1WFs+r5TqrDtInBzFrshr+Ch s0tOwFyv25tyfRzFh4lZ490U1esDJttVHexVUIYtBpJ1ypmgh8mjxDhvKvQ0glnlEfT+ c6qorZj29yLHB6uBQWUh2lM+svz8NaZ15q5JWFxRTbxN497gLvOpF3QpIxbuDybfc47C VBww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jTOdTg4zMLp3lAUC3CF8x187oP9di82IFkmBiyOE8hs=; b=mVid2Ms1Po7Pf2riI0fA0kasyV+EP29bzSbnvW7uglurjL3sXaviqNboCUyM+xNraP rKNGrJKEf/wgL7KtHWmPAwwpyukhnvjCpt4e6Rnl1j/+5B8E8QR4UhvZm264Rb2tYt2M zDP8oBBOMLgqPVIo3GEjqvaunuCJ2sYFkVDy9iXP1aRnFOlN2bFwhcfl/qVxrv3qo9AO u1yCJ6tKICqKPfZQTl9SfjGvbH/GotGr7GOaiuSK/CQOBmF7sYxCryrJvOxJxwbEnZNJ rfTcXeSMpFBgiWO1C2US2fUK3D7htmONRwPxHb3I2IACBMItrXC4PR9ryW4FJWDABlZR N4bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PAi13fgo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di13si20128993edb.412.2020.12.28.08.25.03; Mon, 28 Dec 2020 08:25:26 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PAi13fgo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732287AbgL1QW7 (ORCPT + 99 others); Mon, 28 Dec 2020 11:22:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:41416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732224AbgL1NNY (ORCPT ); Mon, 28 Dec 2020 08:13:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E221C208D5; Mon, 28 Dec 2020 13:12:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161163; bh=waV4/zyCcsTYaqm0wBqC73lPK4M+tQcsB5fXUOYMaZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PAi13fgoeiIHhsK+HcXj04I9zig0E1DWf9S3RvO/VjJ5VI4nGD2y3p8Ko1uBfcKax SFLCJT7f/8p2pDef6sZGSHG6KOvBpgy4jJzF/UFxbp5oULzbea8VblrbCWJlHEScJV YP+p3Pg8CEKqhWURh7MFPWWehEH9+3EI7MZT55+M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Kalle Valo , Sasha Levin Subject: [PATCH 4.14 123/242] ath10k: Release some resources in an error handling path Date: Mon, 28 Dec 2020 13:48:48 +0100 Message-Id: <20201228124910.751751761@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit 6364e693f4a7a89a2fb3dd2cbd6cc06d5fd6e26d ] Should an error occur after calling 'ath10k_usb_create()', it should be undone by a corresponding 'ath10k_usb_destroy()' call Fixes: 4db66499df91 ("ath10k: add initial USB support") Signed-off-by: Christophe JAILLET Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20201122170358.1346065-1-christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/usb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/usb.c b/drivers/net/wireless/ath/ath10k/usb.c index f4e6d84bfb91c..16d5fe6d1e2e4 100644 --- a/drivers/net/wireless/ath/ath10k/usb.c +++ b/drivers/net/wireless/ath/ath10k/usb.c @@ -1032,7 +1032,7 @@ static int ath10k_usb_probe(struct usb_interface *interface, ret = ath10k_core_register(ar, chip_id); if (ret) { ath10k_warn(ar, "failed to register driver core: %d\n", ret); - goto err; + goto err_usb_destroy; } /* TODO: remove this once USB support is fully implemented */ @@ -1040,6 +1040,9 @@ static int ath10k_usb_probe(struct usb_interface *interface, return 0; +err_usb_destroy: + ath10k_usb_destroy(ar); + err: ath10k_core_destroy(ar); -- 2.27.0