Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1199762pxb; Fri, 21 Jan 2022 12:05:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJyeRVtazBUzM5bKPJLXxTuL1eQeNv1WT5YOvFVFdcwLvVyBBvlss6b/HMgm0qSshUbfWFYL X-Received: by 2002:a17:902:f550:b0:14a:87f6:30bd with SMTP id h16-20020a170902f55000b0014a87f630bdmr5599902plf.52.1642795545419; Fri, 21 Jan 2022 12:05:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642795545; cv=none; d=google.com; s=arc-20160816; b=QVqyMlypawWREQW8vYukDdGj0j+Ena3vDZStOlj4DT5galwOOaqoFM5zh+SppDMCyV veqq/1/0uy3LpVQHPJ/tRxZsllGmYPXqqBszS3cWSphUNIrZL4rgvIEWNm6+hgtFeqel XzCs5IB5ikzv5fe5S777rkLlrj4DYDLAuiC2Zo1SUlnpAOZbdkSk/7UYeTJm/ypQHch3 zb53N2RVKUDdLE9IjCjNB4IBfyKQqF46Eev5wBzweQ7994hYgHR+N2wvehIxoB1fX9xl dK5MbFl4RLtkD3aShMohrTLSNW2b5b4l2FJG+eguaUGdaFoMXm0luPXnUituBJ4mA+nx iqJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=8xNKNi1LRojJeVt1Nef5G921Lvb9Zw/m0g+80h/uJSo=; b=jsmGZm0i088G91PvLUCyNEVk7E6O8YvbUtxwMdCLz7bntGj3f7TG1UiucYsBkPgE9M kfThgCsNXkoBFy78zTIx2CX9TUsmG2nwrq7GwQ22HaizDEwfVKT5uSNzQYTWxKbN2/5v /NfCPZjsSxOQh9+TWpPXjjtI02WSHXiURp4dJk5DK1JbvO4tDeFKaj4sDvLcVVJxSTC5 ceXdv1Z5TAYUlzlSkGbPnKGb+6i/QyBGaTsxPRot7w7Ni50gJfplFptqPIfDORYT+AN2 0bcdz3oJIkZCk6/lh8stuC4u4yzyXZH2nBrQM1t0/3dsmy+AOJvSFms2ikbkjdo6pt4A zhPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SkamCFGO; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si7556739pfg.171.2022.01.21.12.05.36; Fri, 21 Jan 2022 12:05:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=@gmail.com header.s=20210112 header.b=SkamCFGO; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357389AbiASVWr (ORCPT + 70 others); Wed, 19 Jan 2022 16:22:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbiASVWr (ORCPT ); Wed, 19 Jan 2022 16:22:47 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0F79C061574; Wed, 19 Jan 2022 13:22:46 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id o15so13370277lfo.11; Wed, 19 Jan 2022 13:22:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=8xNKNi1LRojJeVt1Nef5G921Lvb9Zw/m0g+80h/uJSo=; b=SkamCFGOsuq/rDEk6pV84f1GSUdxKbi/UN0kRg5ytrVxjwIC4oXlo8DKtUipEQtCmf as4pwgaaAHm1qbd/ypGFAx0WQb0exzSaNGUtVp5IH45Sct0tUnHMH+x6w3x7lfvpMVQG AgL3OtR+fxlelKv8GwmgK6mqB5CK6DVVscl6/yy7M0qpPiotY/zc2o0bygCJmGQ8s1nC +/ZbvZz6Kza/T3UxsFF9/5SYdDBgxWtM9pZ9NIxSPvK0uDEk1m1k7uYablP3L0Fc9R7Y qX1JMjDCkJghd8VQC+i25BZ3B32Yxht+JP9mi2fS7A17PA+9ghFn6gCloaTWmd2bVC0t /XvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=8xNKNi1LRojJeVt1Nef5G921Lvb9Zw/m0g+80h/uJSo=; b=ydydbfARIBgfcs8Jh7K0qjF269g9GLaubN8UNkrI3U9nKT/1nznUDLYYj9anWzunM8 kNyet0FB7jCTQJ88+NeEu9H6ad+DYP41xKlOpzOzFPCSjkCHikUgFXmPNwchbGlXokVH RtgaGqDPW4x37ZW04TaQ2+e1YXqD/TjyhV2O/0aAYz+MAS63BvfaO+URUj3kFcbgkW+g 3dkUt30mqyaP6nl88Rq5z1loypwqDRgx7JRpAH7U+9QCJ52/3Q3rBHm+Wcm6yp/i2gsP ptAZC/pYP12flRtqH7Xss4epQyL7Ydt6LbZcE282eV2owTbN7fResG2CkREG0qf8yLQ0 9xYw== X-Gm-Message-State: AOAM531E/Ey+f/H0UaUYkbF9x+HuR9tAWbkzceiKP8gBbnxawNfLNtHh yz1Mkm9I/k/WkYFEmW5FXn0= X-Received: by 2002:ac2:518c:: with SMTP id u12mr30171416lfi.299.1642627365178; Wed, 19 Jan 2022 13:22:45 -0800 (PST) Received: from [192.168.2.145] (109-252-139-36.dynamic.spd-mgts.ru. [109.252.139.36]) by smtp.googlemail.com with ESMTPSA id m17sm78789lfc.130.2022.01.19.13.22.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Jan 2022 13:22:44 -0800 (PST) Message-ID: <9a222199-6620-15b7-395f-e079b8e6e529@gmail.com> Date: Thu, 20 Jan 2022 00:22:43 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3 1/9] brcmfmac: pcie: Release firmwares in the brcmf_pcie_setup error path Content-Language: en-US To: Andy Shevchenko , Hector Martin Cc: Kalle Valo , "David S. Miller" , Jakub Kicinski , Rob Herring , "Rafael J. Wysocki" , Len Brown , Arend van Spriel , Franky Lin , Hante Meuleman , Chi-hsien Lin , Wright Feng , Sven Peter , Alyssa Rosenzweig , Mark Kettenis , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Pieter-Paul Giesberts , Linus Walleij , Hans de Goede , "John W. Linville" , "brian m. carlson" , "open list:TI WILINK WIRELES..." , netdev , devicetree , Linux Kernel Mailing List , ACPI Devel Maling List , "open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER" , SHA-cyfmac-dev-list@infineon.com References: <20220117142919.207370-1-marcan@marcan.st> <20220117142919.207370-2-marcan@marcan.st> From: Dmitry Osipenko In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 19.01.2022 20:49, Andy Shevchenko пишет: > On Mon, Jan 17, 2022 at 4:30 PM Hector Martin wrote: >> >> This avoids leaking memory if brcmf_chip_get_raminfo fails. Note that >> the CLM blob is released in the device remove path. > > ... > >> if (ret) { > >> brcmf_err(bus, "Failed to get RAM info\n"); >> + release_firmware(fw); >> + brcmf_fw_nvram_free(nvram); > > Can we first undo the things and only after print a message? Having message first usually is more preferred because at minimum you'll get the message if "undoing the things" crashes, i.e. will be more obvious what happened.