From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 567F8C433EF for ; Mon, 29 Nov 2021 13:42:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=m8U3T0WucPNB2FtaTM4JXNLOvhR9fIplWW2UMfyFmsQ=; b=XTBf0H8CJ1lyNI C8y4MS2h8sqnHBz0Vt0kSQR/JgLEUpjCMmRh9x6zPUCHMT9L6IBdczUgR33Ana1rqQsaC1g60JS83 BO3p1V+gPL3OPwqDcSSrUtPwe9GWnk3/v5gLcBqY6gVV+6OuwZ0Txs2vuKZoolzjo7dk2cJR1CX8V smKOb4EpjqMrBSh/tg+QqMy3rKKxml0DvT9oarlzfd5T+WX+FwBUgm58WSJvb7ulHprYDNznZiYLe bk1DSRjFci0J33dUTWiQ2CfAsGVr/MChE3xbQaqIbNifMnsEeWwG31gzgv/05ceMw6EHIhG0XLMHc qPscf+3aSGmymEVnGrew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mrguD-000sIh-78; Mon, 29 Nov 2021 13:41:17 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mrgu9-000sHZ-7W for linux-arm-kernel@lists.infradead.org; Mon, 29 Nov 2021 13:41:14 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7DC2C1042; Mon, 29 Nov 2021 05:41:12 -0800 (PST) Received: from e123427-lin.arm.com (unknown [10.57.34.225]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 073773F766; Mon, 29 Nov 2021 05:41:10 -0800 (PST) From: Lorenzo Pieralisi To: Christophe JAILLET , robh@kernel.org, bhelgaas@google.com, kw@linux.com, michal.simek@xilinx.com Cc: Lorenzo Pieralisi , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] PCI: xilinx-nwl: Simplify code and fix a memory leak Date: Mon, 29 Nov 2021 13:41:05 +0000 Message-Id: <163819324863.26090.8890227197735152343.b4-ty@arm.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <5483f10a44b06aad55728576d489adfa16c3be91.1636279388.git.christophe.jaillet@wanadoo.fr> References: <5483f10a44b06aad55728576d489adfa16c3be91.1636279388.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211129_054113_339174_339679A2 X-CRM114-Status: UNSURE ( 8.83 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, 7 Nov 2021 11:04:43 +0100, Christophe JAILLET wrote: > Allocate space for 'bitmap' in 'struct nwl_msi' at build time instead of > dynamically allocating the memory at runtime. > > This simplifies code (especially error handling paths) and avoid some > open-coded arithmetic in allocator arguments > > This also fixes a potential memory leak. The bitmap was never freed. It is > now part of a managed resource. > > [...] Applied to pci/xilinx-nwl, thanks! [1/1] PCI: xilinx-nwl: Simplify code and fix a memory leak https://git.kernel.org/lpieralisi/pci/c/e2b86f9777 Thanks, Lorenzo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62515C43217 for ; Mon, 29 Nov 2021 13:43:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240732AbhK2Nqb (ORCPT ); Mon, 29 Nov 2021 08:46:31 -0500 Received: from foss.arm.com ([217.140.110.172]:39724 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237756AbhK2Noa (ORCPT ); Mon, 29 Nov 2021 08:44:30 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7DC2C1042; Mon, 29 Nov 2021 05:41:12 -0800 (PST) Received: from e123427-lin.arm.com (unknown [10.57.34.225]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 073773F766; Mon, 29 Nov 2021 05:41:10 -0800 (PST) From: Lorenzo Pieralisi To: Christophe JAILLET , robh@kernel.org, bhelgaas@google.com, kw@linux.com, michal.simek@xilinx.com Cc: Lorenzo Pieralisi , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] PCI: xilinx-nwl: Simplify code and fix a memory leak Date: Mon, 29 Nov 2021 13:41:05 +0000 Message-Id: <163819324863.26090.8890227197735152343.b4-ty@arm.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <5483f10a44b06aad55728576d489adfa16c3be91.1636279388.git.christophe.jaillet@wanadoo.fr> References: <5483f10a44b06aad55728576d489adfa16c3be91.1636279388.git.christophe.jaillet@wanadoo.fr> 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 On Sun, 7 Nov 2021 11:04:43 +0100, Christophe JAILLET wrote: > Allocate space for 'bitmap' in 'struct nwl_msi' at build time instead of > dynamically allocating the memory at runtime. > > This simplifies code (especially error handling paths) and avoid some > open-coded arithmetic in allocator arguments > > This also fixes a potential memory leak. The bitmap was never freed. It is > now part of a managed resource. > > [...] Applied to pci/xilinx-nwl, thanks! [1/1] PCI: xilinx-nwl: Simplify code and fix a memory leak https://git.kernel.org/lpieralisi/pci/c/e2b86f9777 Thanks, Lorenzo