Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1655064rdb; Thu, 25 Jan 2024 02:06:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IH31t+vzOyQrirXjqDLOZUoqxoDz0EV3azzJ9BcOvsEDfUOdOoGDA7tFhzPH6OhucK7I4Pv X-Received: by 2002:a17:90a:3d01:b0:290:2cf6:9780 with SMTP id h1-20020a17090a3d0100b002902cf69780mr558235pjc.22.1706177203360; Thu, 25 Jan 2024 02:06:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706177203; cv=pass; d=google.com; s=arc-20160816; b=d6DPPQuUW5f7DdaY/89zbvjsD3if6UqzQSb9mLmI2cWxgpHIOm8EU9np1E/Gd6VLRd cSDBMvdV4QvXuhwVmArkM3LAIysOGVsoPhECAXGX/wVNTCtoQGxSk4E1wRMYUh8kLPjA kT0vBeerBJTUmEFX37IJTg5pSXlLRwtmPUoXD+2S/PpzBkQcKP/5IOF81+iYB6YGYWKs MIz3WiI/PN8+DQ3X1PdGGXy+3awvpXsTrKJMLNmuWDIIYx3cta32nmJ7zCjMVTq9vjay OOWkAVZTxQ4oZvsv+5LB6bXcAswxnKrXydjUNZGaAuy4uAtVNo7DLEPhWBzkzqEtKPrB 6mBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:subject :references:in-reply-to:cc:to:from:dkim-signature; bh=VPAvoqsnfMB6iTf4ATLXOS7VrQRK09qsvR+ezq4vI8E=; fh=UVr7WZfnzcwzblzzcugFLIjMs8Z0vIHj8CHHSoHoyBM=; b=AYvzBmHpVMO6x8VNTVq/pUqNQJ44OFmSjY+jhGhiqen0Gw7rfaBhAFKab421nLLSvI m6535ZVh+jYE6Ikfhy9/rGNnpI97VVWiC54VZGyFRSMFqttMxNjQCDLP8vI27gDjsuM1 0s1dI2LOITIvnWrf0h+qt1q3AoTioiUuIaEB9zcM4Tr+O/RllVbfV4XeKDZOX2aOOg0R eqbC4Iz4W2p7uFiaPFWkNmENy/hTL9d7kSyPxhnF+ohtivGFkXwn6CUUqx2TvZ9ZpMu8 pGi+LjpqgBTcrstzBj56mW0xnKadHO1YCRAHdTkZZjsjhTbEC93WSfGzc+FNmqh3gNeg 9Ncg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G3NXLkPP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38345-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38345-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id lp12-20020a17090b4a8c00b0029309f3e5f9si158007pjb.63.2024.01.25.02.06.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 02:06:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38345-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G3NXLkPP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38345-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38345-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CD6862842A8 for ; Thu, 25 Jan 2024 09:57:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B40F1C6AF; Thu, 25 Jan 2024 09:56:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="G3NXLkPP" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 553C01BF33; Thu, 25 Jan 2024 09:56:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706176613; cv=none; b=miJFd4jgHdYvj88a6R+g8/nvxK/4laYzwMwKNIOuNRoau2IRnXZRRi/w6JfFb7EpVu1u20IihvrvXCkVJpfGmKCl9xhpAev5CIswYwLSaE4RHSuSfgBIWacwavwwv35Yjnx9F2XfVj0N5surkl6b7jrj4FZkUzGaq0e6LNEJLwE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706176613; c=relaxed/simple; bh=nyvlz6SRusR/COWQ5ImICpj/0AOiXRpWb9Sjjkupgxo=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=alrZillo7xy4hZ8bTChG9qo2Xy3stlUoeLAmwS41rjINK9WYmlJysKSO0c9sAOUhhuzvsgk7cfuOhYe8BK9ntDTVqIYrSpdLW8dD01AtYCZ+ccQI0W7R0QuAcrSj6KXIY5+noZwFxSPx0BS939y9HedTNLOQs1JSMziXTiudsmI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=G3NXLkPP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42616C433F1; Thu, 25 Jan 2024 09:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706176612; bh=nyvlz6SRusR/COWQ5ImICpj/0AOiXRpWb9Sjjkupgxo=; h=From:To:Cc:In-Reply-To:References:Subject:Date:From; b=G3NXLkPPYUC6LgXJ+FqNhyCm1Vf/bwGwNiZtloHoAmVyyhHn6Yilflejp+kDkZtK9 u9v1aLglMAMGd1VQv0HvvnCIOWUQy8WBdP6720+f/fF091duUzq/jx8qE8UVHNhxFj bffYbhOdT7mSwlmS5y96yvd9EblVUg8ajzK0Z8cb2/91b6Iv14IZV3opdQfxY4L4Nd I31meMrEU/Uhc2XjfxqluLmy249PH+2+yGRxhAQNT9slD5qi7pIJkoTLhzxgEmr5I0 L/VaqIojDDyN/jKVqw7LWi+0HCE3W6yhEisbxgdABffn5MUTzo9uJucuTrQWuOPM10 p23BWVJijdvmw== From: Leon Romanovsky To: Zhipeng Lu Cc: Dennis Dalessandro , Jason Gunthorpe , Jubin John , Mitko Haralanov , Ravi Krishnaswamy , Harish Chegondi , Brendan Cunningham , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240112085523.3731720-1-alexious@zju.edu.cn> References: <20240112085523.3731720-1-alexious@zju.edu.cn> Subject: Re: [PATCH] IB/hfi1: fix a memleak in init_credit_return Message-Id: <170617660887.632552.18288740821667270978.b4-ty@kernel.org> Date: Thu, 25 Jan 2024 11:56:48 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.12-dev-a055d On Fri, 12 Jan 2024 16:55:23 +0800, Zhipeng Lu wrote: > When dma_alloc_coherent fails to allocate dd->cr_base[i].va, > init_credit_return should deallocate dd->cr_base and > dd->cr_base[i] that allocated before. Or those resources > would be never freed and a memleak is triggered. > > Applied, thanks! [1/1] IB/hfi1: fix a memleak in init_credit_return https://git.kernel.org/rdma/rdma/c/809aa64ebff51e Best regards, -- Leon Romanovsky