Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp704712pxb; Tue, 5 Apr 2022 19:33:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6aMi+BYRZAmn3Gknx8OJ/57qAofTumrw+mPxmXx8LUlN3znVbnh8ygJJRTS+NyRrl1mJ3 X-Received: by 2002:a17:902:d64e:b0:154:bc8f:b6c5 with SMTP id y14-20020a170902d64e00b00154bc8fb6c5mr6316325plh.157.1649212393615; Tue, 05 Apr 2022 19:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649212393; cv=none; d=google.com; s=arc-20160816; b=PqlTriSuJW09WtABQG8uvU1GvvGFa8dT6vOHYszZ8MTg1hebFbSLRIYcmbDvXiUgWH 3UXmrprs5IJzefXAQNo+xwB0VSnqOrmy5/MPfLlj6UK+GjvEfKnBXw9efbZqdkoTNKQF ZNdXiMRXiNloS7LOXsQ3EOQgq+1dhMH0GOC322gjiSKebrMC/H4vZb3sG061SD3JPVAh Gr569N1bGFhOaCedBaD4PrBYtkysnkw4DFZnZhp1zM9Ac5VkirL82RIUDuBOHCBIpyrs wvI90FAHuOcehkIxcJGOD8ryfymOrdCobCrgNFT9Fd9UKqvotKDh2apZLhwcV3k65Xcm TFaA== 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=fjxeTF7zqWxg0cTxpofJZNGyhc2VyT1EvgZavmhK3FN7hZlLiaX+dsrL/R0kJoJOAp IUqal8e31wsLjt8qO877Xu3dvPMMUwDvKy/dqz7yfjPWa9qwcoVaPN20TW2kHYZkr1To R0EaQzp1153PvB0AXMFRcCapMjMvjst+/IwnbSApvLSX8k5eupXkpPWowMVYZbBE2laj E8bRjq28XYrlIhSPMq0zEg+zQJOHQTUdMkPhsXGPGmi/MOBTYZFfL5/UGTq3Y+YSBT7A 9wHa5oO5Fd8XZy563ws3q1+Rmu5/ce4BQqkXJSV8DxPcJgoc/JoK992bM8g3qtXkaUic lRkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=prq6vFwM; 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 p15-20020a1709028a8f00b001560318de2csi12987125plo.318.2022.04.05.19.32.59; Tue, 05 Apr 2022 19:33:13 -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=prq6vFwM; 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 S1355413AbiDEMWu (ORCPT + 99 others); Tue, 5 Apr 2022 08:22:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244564AbiDEIw0 (ORCPT ); Tue, 5 Apr 2022 04:52:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7F0FD760D; Tue, 5 Apr 2022 01:41:20 -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 ams.source.kernel.org (Postfix) with ESMTPS id 8BF33B81C82; Tue, 5 Apr 2022 08:41:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09237C385A0; Tue, 5 Apr 2022 08:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148072; bh=fA6jlSOTDUzNe8YCEepk5YnDTbZKLllnbhM2A2nSFIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=prq6vFwMJCSr8OGmrng7Lqip6LhZNl/VoiHJGtU+0TqYoC1t+o5Gh4ostj1yhFxs9 IB4ZaHG3hVjNuVOeh+JKlh3gNLH6RZB+fjUAzGZ2cnXBO0R0DBbagJ/lEU3PM5/8CW IGxXHKorWjchEkF5hXoXyAAWdXAPJFsg+SNJHdrs= 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.16 0191/1017] brcmfmac: pcie: Release firmwares in the brcmf_pcie_setup error path Date: Tue, 5 Apr 2022 09:18:24 +0200 Message-Id: <20220405070359.912338013@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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; }