Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp672169pxb; Tue, 5 Apr 2022 18:10:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzX/GbO/BR7oM4zbUtrmh1m6bQvhSLqqABO/dY9lzAyLzrV5p4QvbNXMdvLntY+tC4/OprV X-Received: by 2002:a17:907:94c6:b0:6da:9561:ce0 with SMTP id dn6-20020a17090794c600b006da95610ce0mr5879318ejc.342.1649207428230; Tue, 05 Apr 2022 18:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649207428; cv=none; d=google.com; s=arc-20160816; b=D1s5cNBN7yhBXyQ0ZPgD1bRfcICDCB5f/oOqaWhUYDZXlnyXnoBwehgreeTS44xnKN 5pNkRxKiN0Pk4jHiX2jn1H0/V1cNdu2DOXORbifl3gBv9+VxUTWWFev2AiDMhTVk20pY +k88+qB2W12nUVtS1utZHgah6UoVsIW4ExX6zSdaG5xQS/RSHJDaZyGK7uwdqtWImglI D0/X/kekBDIU/n4lib/c1DZgmCh6eSKPsfzw4FtTBrvCMMTa2jCw94bl+6eEWjOs7zlK MBsEl70oH5/WB0IVeIpWDgUVLnN2NIKmiujqgmw831uBetAjIKMf537U6YKFhbX88mND Nr7Q== 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=eHzPD5ADhTHId2fL1qkC2qeri7Tbt/dWitDpRCFu68Q=; b=Lz2dy9H2PK9G18Ytpqh6db6B5RSlA/xjxGEF0FWC0n2XwvyzB6dOqzAQbTmqnMNQcP rLhhnkLbNtyO8qaeXrwEgz/hei07MYybBjx+K4dqR/KoG6NViF3IC89PULpyzAJVRiTS j+C42KcA7bJNF+nB2B4pvf6QKJnLh7llraBXak70NCz01a7xy01e+4qi2s3156+wE6Wi kvXjFPaomUZh6HPgUCBWg5IVHqlXVvGqWGNFwW8UAvIJQyQXDiMRm72SmqhULTQx7Bnl SkFzE2UTuwXqMe+OJz1UPRbzj4/UTK7e3pvU97IIEikrv7NPJTxYj60WNLqOpTVfMLQk O7jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j1KfgMux; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m26-20020a1709062ada00b006e7ec7fdbfasi5452218eje.447.2022.04.05.18.10.03; Tue, 05 Apr 2022 18:10:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j1KfgMux; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S236236AbiDEIBp (ORCPT + 99 others); Tue, 5 Apr 2022 04:01:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232461AbiDEHu7 (ORCPT ); Tue, 5 Apr 2022 03:50:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C67D9549E; Tue, 5 Apr 2022 00:47:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 13E19616C6; Tue, 5 Apr 2022 07:47:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BB58C340EE; Tue, 5 Apr 2022 07:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649144833; bh=fA6jlSOTDUzNe8YCEepk5YnDTbZKLllnbhM2A2nSFIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j1KfgMuxL9Y6YI/Ums/M16753BKXNofhQVD6AHpKT97NfGO6FxY+kNGN32/KVJkmG 3g5VZmf2LXRxnHP3l/89dlv2lEH1OB4z/YOXIo648LMSzJ345ozhlAeX0JrF94WtUn pzMGWxU1uj48VdbX8ok4a81tCmsgmN5rEXKdmzZU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Walleij , Arend van Spriel , Hector Martin , Andy Shevchenko , Kalle Valo Subject: [PATCH 5.17 0188/1126] brcmfmac: pcie: Release firmwares in the brcmf_pcie_setup error path Date: Tue, 5 Apr 2022 09:15:35 +0200 Message-Id: <20220405070413.125522885@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hector Martin commit 5e90f0f3ead014867dade7a22f93958119f5efab upstream. This avoids leaking memory if brcmf_chip_get_raminfo fails. Note that the CLM blob is released in the device remove path. Fixes: 82f93cf46d60 ("brcmfmac: get chip's default RAM info during PCIe setup") Reviewed-by: Linus Walleij Reviewed-by: Arend van Spriel Cc: stable@vger.kernel.org Signed-off-by: Hector Martin Reviewed-by: Andy Shevchenko Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220131160713.245637-2-marcan@marcan.st Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -1777,6 +1777,8 @@ static void brcmf_pcie_setup(struct devi ret = brcmf_chip_get_raminfo(devinfo->ci); if (ret) { brcmf_err(bus, "Failed to get RAM info\n"); + release_firmware(fw); + brcmf_fw_nvram_free(nvram); goto fail; }