Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp685820lqm; Wed, 1 May 2024 12:23:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV5Li8SsHhrzHRNMRoV8lM+vd9qPfgrFPR1vBiFGDQW/YA1bLE2aLaTNPmdc2+3U0UVv83ETCtnZe/XTkbdIVxW2sM+XfQmfT76Y00k1w== X-Google-Smtp-Source: AGHT+IH3wjCR9JPuI2a0jZSIFudaRDjmGIIXEglPqugH4H2YzVdZWn4VIcAUM54MVluNr0GH0+t4 X-Received: by 2002:a05:6a00:4b05:b0:6ed:9493:bc6d with SMTP id kq5-20020a056a004b0500b006ed9493bc6dmr4582356pfb.12.1714591430472; Wed, 01 May 2024 12:23:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714591430; cv=pass; d=google.com; s=arc-20160816; b=ipl9IaMNimITW5c/cbrScAiUfx6khfL4LaSI2SUHk1r1gcWvrgL8XzOQUot0t0r5Vk AC/+kgL8vJ3mMW7nno8V7KKMTyFVezOJMZegUq4PPPF2PnR3S4aye5/bL9qFpylFZXsw uakmBn7qABuUDeOSG48wGOJMYbupvZn7P7gJvLpc0P2nZEdp/SYGOpyJtNugzMdfCb/8 hYfWyORdzHdgwQDxdbvYG4vUoTzfe+Wpw35Aid+v2Ww98fLdlz/fZxUoMHVtxwpRuzPG szC5LDF4cOPDWP8tU6KM91vHPmUkBUwcp25XiKvhxCqR8kam4GcVP96ucc0PnhFA/ITY BTcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:from :content-language:subject:references:cc:to:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=/OzIEN8wYE8/xcGiwbU+dTt00S833gZJ8vZlKH2nXNM=; fh=ysNCaaKxQFG1oTrrlMl6YEWux33IqDROR2Ld3JuvYco=; b=ydrERMkQ6HtOCNjNezVjztiTLcGhxlBhTMXK8BcOVCIBn0u2kQZQMIpNNk2+lxnxOU nfq5Zcvmuk0LfT6mwHIhL2XCjTaXeOHScO/HZrbeEpRYHLMt70tWVLKH3e5nzmdcl8Pi ruUZSnCi2a/93Et6z23EDNDPs0/cHcRSgqY3UJt8osMFM8IskayX4xB5YWaXPfK/2yFY nsLYHgvQBil4DdGRpgbvRe/EaUFcDAYfO7J2E8Vi8YrKY2hTAx+kpdeTmS+aClr56sw1 X+Rp2etP9OtpELJNTRQmBIepNOa8/P8x8JJQ87RHhsI1rAU6r84+TcWVPCixRZMqx/0g vPrA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=axSUFWsB; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-165708-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165708-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q3-20020a056a00088300b006edc97fdb8dsi24877436pfj.70.2024.05.01.12.23.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 12:23:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165708-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=axSUFWsB; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-165708-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165708-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de 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 20972283E3F for ; Wed, 1 May 2024 19:23:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C843161320; Wed, 1 May 2024 19:23:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="axSUFWsB" Received: from mout.web.de (mout.web.de [212.227.17.12]) (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 B1E83EAF6; Wed, 1 May 2024 19:23:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714591419; cv=none; b=SUga2qzeIiBOsscheiPcaMkJmI2CHGRP1FX2GqiqQpHXLZ8doi7qTgZRUkhlXlQ10ko88ag6o3WNCCtId8dzPEbuEp7swptOnQmxIbBDSC4mit1JfiWgtqXJ1auF6G8wclWhQ/7/4b54HW7k6ugZVloGGgvAVaUoI3iqWdL5bxE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714591419; c=relaxed/simple; bh=WgZXapr0v/CdZ4lJn13J0ptgvUQhGg3IHPNnu6AmuXQ=; h=Message-ID:Date:MIME-Version:To:Cc:References:Subject:From: In-Reply-To:Content-Type; b=XhhRd8no13IjEZfmyJsRAOYuALVJZHgsxLrmabURaQKynBab1JzZlXwYST+XVrfCKX7nwpSH4FZB4gdYEa0sdrFHgu7oh8b8kyOU2U4WqWxD6N5M70Ql4i8Nm2Ead2abSxJkCjLb4cFP29PQgyVk9Uev0RDhSP7CsxJTfHMuXZA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=axSUFWsB; arc=none smtp.client-ip=212.227.17.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1714591395; x=1715196195; i=markus.elfring@web.de; bh=/OzIEN8wYE8/xcGiwbU+dTt00S833gZJ8vZlKH2nXNM=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:To:Cc:References: Subject:From:In-Reply-To:Content-Type:Content-Transfer-Encoding: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=axSUFWsB4NOlK4yB+jQ+wR92elH6D45V0USLzzge2n8VkSoRSNgwCr594VQ2cL1a woA0rQaDX2c01haPFMjvY3QU9qjNTHvDC1v66KvtRGUT/PfAsIpNBryAebsgbeO54 /AxC7bq3AxTBOelxif+w4R0Gf81PWiCdfMJZ4vfCVIrP6Ew+S/Ek7SNIJaH7iLjoV nMiBa+lpdmTHABtzlobPQo8dCWJHiKPD8M0WWEHKk0A//EBJyHHfACCnunKH9GstG unzEPXXADB1sn60H5RKFsyMqVVOlpMXRtbM40mSSYWGVazdRjAfZlHo9/Xht5UFqc r6J++oxUkWysNJBvnA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MSqXM-1sDu8b0cJy-00URfx; Wed, 01 May 2024 21:23:15 +0200 Message-ID: <44d81ab4-e3e8-4552-ba0c-209adb53aa21@web.de> Date: Wed, 1 May 2024 21:23:12 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Li Zhijian , linux-cxl@vger.kernel.org, kernel-janitors@vger.kernel.org, Alison Schofield , Dan Williams , Dave Jiang , Davidlohr Bueso , Ira Weiny , Jonathan Cameron , Vishal Verma Cc: LKML References: <20240428030748.318985-1-lizhijian@fujitsu.com> Subject: Re: [PATCH] cxl/region: Fix cxlr_pmem leaks Content-Language: en-GB From: Markus Elfring In-Reply-To: <20240428030748.318985-1-lizhijian@fujitsu.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:XEvMWRPs4OkmQfzTBKzTarEa4TnOG7EMBSHd7V4F8Fbt+EmT2R6 lo5wtWziM0498hgVReKPl8EviA9vt1VdyPaIL1Vr9vvK1WqXmRR5gvlyDndncwod0JUrydn 3KJ/3Ur0rFK/wKbgea1ZsPDQHqxca9IzxFwu475Pg94EdXVSIOtjRcKnBSQj9NP9WlkEiUC IpXWeNxGOE83J02oN1dEw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:19MG9NbR1DQ=;wLcBwn45VN2Z/0qpaigxH8Rs44Y AHD83VXPZJnK9DW/AE1HWPxEbaGEERu/pHKJOMjIlUPoLFJOFhHJIuJEiQA0SIeSn5nMk1Dvk gVpycZkOX+u8El+0Egp5t25jSBu3dVN0EyvH3h4FJf1JbwL4f68Y3BPD04ewS745x1eEgI5pu +NQVHVA4NYORMcR+E1iwy4XpA0mqNo2dpvA7+142/a1pSQpfjN0k3bwYJPVEMfvfXUa5QXP9N 8dA21Uh2Bc+w3Wqg7La1Ng+OfwOiNCGpAqIKqs8wMceFI0Iadmtl6t3xP1ffWhoKOwBKG1Uwv RCIYIp5Kxzq3ba8bFJ6rgTNvf8adqMnACVIT/LaSbbFkFvWwDeDSt2cYH+DKTHUKXzR40OjV/ qSHKPjV7JW6oCjmgb6um0bkbWyo3M5ZLS0gJP2O8nPBFpR3eo2/9xGuf/N/avhLRja7r+Nw3k CH/0tEasuQlRBuKkViOc957H400HcLNfsy1AEWZ8ySHFaiDVlVOeM/fSP/mI/DroQVCSGr5zA 2I7hZ43LgtqMgDYpP3uq+RDv0YmgBwVo4fb8/nnM3MjQXgZFYgvz5KluMFAkWBHfReXQgC5bL EAF2hq22XvtEuJP3j57AE5e1O9H3wixt753Hz6bEhK11FV0hlsNlkJWiHVhnHWPrargpA3D1W 0xm1xx774jxjERjk1Td15iMdssDDCyNRvKQqiUdIAFHjUlYbNWzHXQSkUNj2A4tmrgV8OYEV2 dM7eoNu5u+9WDq/SpkWt0hCAxAB6rNMW9dcCpzx1gjLIujZtgIMs+0C9yZyuNfIA4dAJ1DjDs nNL3Bxhl/8wgx31NW1lfwHP9oGD8deNLusoyRSWZfDDpI= > Before this error path, cxlr_pmem pointed to a kzalloc() memory, free > it to avoid this memory leaking. Can the following wording be a bit nicer? The local variable =E2=80=9Ccxlr_pmem=E2=80=9D referred to dynamically = allocated memory. Free it in one error case before it is reset to an error pointer. Would the summary phrase =E2=80=9CFix a memory leak in cxl_pmem_region_all= oc()=E2=80=9D be more appropriate here? Regards, Markus