From nobody Tue May 14 01:15:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109217+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109217+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1696024763; cv=none; d=zohomail.com; s=zohoarc; b=GlFbcQOshyXxN8SOOoJF4Wqp6MekhFsWY6amne98bDdxCs6gJwv1gcTbKleffpzigXZu1v//fE/gv0V085uI6WqrreG5vOmfuJX2LSd+ivWbfzQ6xgkJ80YGx9Hj+TDHc2CAnfQI9ed46hzuxX0ZGWD02OWll3auBDmfRg9Ex8U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696024763; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=HEk6h0npTRuvc0hB8yhiZdHArwavpFA5iYDfZ5TGuZM=; b=lM2yvde4OYaAT4HvHbgqKuwkKIoqFMGVSNf35tckifXuIUq552abMj8sZ+iY6TJgkIHTM36C59PfbsQsNk2C3rWqrpfCXXBP4r2SvOa5ylfxzRqfWR4qHMxW45UgHZrkAomzjJMWVNNgbko52NPjiAKpiJ8TQ0pQj6zS06SRgG8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109217+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1696024763425272.58347499729484; Fri, 29 Sep 2023 14:59:23 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=3ze54hKr1VxV4IUmJCfgoXRX7bWlQcusGh8fR00EPcQ=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1696024763; v=1; b=Hu5KSpatEJf7Ozn+eD/G2v2atOEAVN0H4/NnIbmMBUu+p6YcUcCa2AbO+2n+gaV7jX0xKRg2 4FtEe3waxTDZJXASO2/QUmPXsLHAG8f8/lnHNayrT0fR3n6ID5VQWoXDxzeJM7ujLNaHn8z4JKf KzoCdWPyopY+hljSUtD0PD1c= X-Received: by 127.0.0.2 with SMTP id 42M1YY1788612xptdy6UdVsy; Fri, 29 Sep 2023 14:59:23 -0700 X-Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mx.groups.io with SMTP id smtpd.web10.30357.1696024762203614022 for ; Fri, 29 Sep 2023 14:59:22 -0700 X-Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2c2907ff9fcso2394451fa.1 for ; Fri, 29 Sep 2023 14:59:21 -0700 (PDT) X-Gm-Message-State: YwZ1rjyE7HtkkzoLHc6gMC0ex1787277AA= X-Google-Smtp-Source: AGHT+IGt/oQ4ByCyOdeagzvkbn2G7a56Fiu6OroWjC3bGlPaVPw/RggruuGUKtr/3/BWbKqxcaIAAA== X-Received: by 2002:a2e:8442:0:b0:2c0:17bc:124e with SMTP id u2-20020a2e8442000000b002c017bc124emr4235570ljh.38.1696024760059; Fri, 29 Sep 2023 14:59:20 -0700 (PDT) X-Received: from localhost.localdomain ([185.9.78.108]) by smtp.gmail.com with ESMTPSA id y24-20020a2ebb98000000b002bfe8537f37sm890178lje.33.2023.09.29.14.59.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 29 Sep 2023 14:59:19 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 1/9] RedfishClientPkg: fix format used for output __func__ Date: Sat, 30 Sep 2023 00:59:07 +0300 Message-Id: <20230929215915.46616-2-mike.maslenkin@gmail.com> In-Reply-To: <20230929215915.46616-1-mike.maslenkin@gmail.com> References: <20230929215915.46616-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1696024764298100005 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mike Maslenkin Reviewed-by: Abner Chang --- RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c b/Re= dfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c index a969557ddfdb..f96c90cc945c 100644 --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c @@ -788,7 +788,7 @@ HandleResource ( // Check and see if this is target resource that we want to handle. // Some resource is handled by other provider so we have to make sure th= is first. // - DEBUG ((REDFISH_DEBUG_TRACE, "%s Identify for %s\n", __func__, Uri)); + DEBUG ((REDFISH_DEBUG_TRACE, "%a Identify for %s\n", __func__, Uri)); ConfigLang =3D RedfishGetConfigLanguage (Uri); if (ConfigLang =3D=3D NULL) { Status =3D EdkIIRedfishResourceConfigIdentify (&SchemaInfo, Uri, Priva= te->InformationExchange); --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109217): https://edk2.groups.io/g/devel/message/109217 Mute This Topic: https://groups.io/mt/101667460/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 14 01:15:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109218+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109218+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1696024764; cv=none; d=zohomail.com; s=zohoarc; b=Cnjv+MBoi4rzRv50qrvoWy8BtMvFZo/L53g+1bcsU2F1dFrrVuR5vz+hTSm52LyFAmENZcofdKiHtMT9StLZS4V9bxoe8w2tBI5o20ubzi3sC5fWXbs0LCCq718BnGa/SpyEfWqnyLdBwBGfwR3Sw/YjTd/c9otDmqm0uwsRsvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696024764; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=cfukewlm9grz49JW2l18CHwF/QN01Rt3ghIeZcfOc44=; b=Gou5DLkbJqxjbPBKpL9LjUcx8Iw27qimpT6WjVkcG6mJEErgdGnGR80R82h+DgoR/8t2vwE6pbfFkBx8JBtu/12LSIgdpvnKQCPBWUo/HgxDkkNh3AtVuQmduVTa+AgLv0z7zjdgqNYfjaNtyBoJRmpgWueIb+QWlYLdOjXWb1Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109218+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1696024764153179.22578885103974; Fri, 29 Sep 2023 14:59:24 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=lZKOuPNzcsV76YgSHVbMzEppMfgmGcFlOaqu+CHkNqg=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1696024763; v=1; b=n4C8KPf0TwK0aKzlsTR78zw/E56J4L0LrmA1SSlzzETDLw/B7t16hFZ3zQPeO/ndnoN+1LQA HbfCk1ruknE2y9turbLV0SvsVMXy3rEVftJ1t2LaW0oyS4a4OOkeNaNXjT9OzbUp+lmO71Sh6gW Y5fQEDEsAnfDTRSxA7QmHhLE= X-Received: by 127.0.0.2 with SMTP id kKDgYY1788612xwku85TQTEB; Fri, 29 Sep 2023 14:59:23 -0700 X-Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mx.groups.io with SMTP id smtpd.web11.30207.1696024762974325563 for ; Fri, 29 Sep 2023 14:59:23 -0700 X-Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2c012232792so239601901fa.0 for ; Fri, 29 Sep 2023 14:59:22 -0700 (PDT) X-Gm-Message-State: Tq7Q6mjBq0Wvt1LqjAmkkd4bx1787277AA= X-Google-Smtp-Source: AGHT+IGNXRsEXd5BPyqfCZc3CyIE05sFfBVkiQyvGT7w8V98WHol1JUIcSynmvBGe0jXWUq0bTkt8Q== X-Received: by 2002:a2e:7213:0:b0:2bd:d34:d98a with SMTP id n19-20020a2e7213000000b002bd0d34d98amr4723469ljc.44.1696024760905; Fri, 29 Sep 2023 14:59:20 -0700 (PDT) X-Received: from localhost.localdomain ([185.9.78.108]) by smtp.gmail.com with ESMTPSA id y24-20020a2ebb98000000b002bfe8537f37sm890178lje.33.2023.09.29.14.59.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 29 Sep 2023 14:59:20 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 2/9] RedfishClientPkg: fix DEBUG macro arguments Date: Sat, 30 Sep 2023 00:59:08 +0300 Message-Id: <20230929215915.46616-3-mike.maslenkin@gmail.com> In-Reply-To: <20230929215915.46616-1-mike.maslenkin@gmail.com> References: <20230929215915.46616-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1696024765199100009 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mike Maslenkin Reviewed-by: Abner Chang --- .../RedfishFeatureUtilityLib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatu= reUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishF= eatureUtilityLib.c index 1e5c3f110de6..35e342c817b7 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c @@ -332,7 +332,7 @@ ApplyFeatureSettingsStringType ( DEBUG ((DEBUG_ERROR, "%a, apply %s to %s failed: %r\n", __func__, = ConfigureLang, FeatureValue, Status)); } } else { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is: %s\n", __func__, Schema= , Version, ConfigureLang, RedfishValue.Value.Buffer, Status)); + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is: %a\n", __func__, Schema= , Version, ConfigureLang, RedfishValue.Value.Buffer)); } } =20 @@ -462,7 +462,7 @@ ApplyFeatureSettingsBooleanType ( DEBUG ((DEBUG_ERROR, "%a, apply %s to %a failed: %r\n", __func__, = ConfigureLang, (FeatureValue ? "True" : "False"), Status)); } } else { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is: %a\n", __func__, Schema= , Version, ConfigureLang, (RedfishValue.Value.Boolean ? "True" : "False"), = Status)); + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is: %a\n", __func__, Schema= , Version, ConfigureLang, (RedfishValue.Value.Boolean ? "True" : "False"))); } } =20 @@ -585,7 +585,7 @@ ApplyFeatureSettingsVagueType ( DEBUG ((DEBUG_ERROR, "%a, apply %a to %a failed: %r\n", __func= __, ConfigureKeyLang, CurrentVagueValuePtr->Value->DataValue.CharPtr, Statu= s)); } } else { - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a %s value is: %a\n", __fu= nc__, Schema, Version, ConfigureKeyLang, RedfishValue.Value.Buffer, Status)= ); + DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a %s value is: %a\n", __fu= nc__, Schema, Version, ConfigureKeyLang, RedfishValue.Value.Buffer)); } } else if (PropertyDatatype =3D=3D RedfishValueTypeBoolean) { // @@ -617,7 +617,7 @@ ApplyFeatureSettingsVagueType ( DEBUG ((DEBUG_ERROR, "%a, apply %s to %a failed: %r\n", __func= __, ConfigureKeyLang, (*CurrentVagueValuePtr->Value->DataValue.BoolPtr ? "T= rue" : "False"), Status)); } } else { - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a %s value is: %a\n", __fu= nc__, Schema, Version, ConfigureKeyLang, (RedfishValue.Value.Boolean ? "Tru= e" : "False"), Status)); + DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a %s value is: %a\n", __fu= nc__, Schema, Version, ConfigureKeyLang, (RedfishValue.Value.Boolean ? "Tru= e" : "False"))); } } else if (PropertyDatatype =3D=3D RedfishValueTypeInteger) { // @@ -640,7 +640,7 @@ ApplyFeatureSettingsVagueType ( DEBUG ((DEBUG_ERROR, "%a, apply %s to 0x%x failed: %r\n", __fu= nc__, ConfigureKeyLang, *CurrentVagueValuePtr->Value->DataValue.Int64Ptr, S= tatus)); } } else { - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a %s value is: 0x%x\n", __= func__, Schema, Version, ConfigureKeyLang, RedfishValue.Value.Integer, Stat= us)); + DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a %s value is: 0x%x\n", __= func__, Schema, Version, ConfigureKeyLang, RedfishValue.Value.Integer)); } } else { DEBUG ((DEBUG_ERROR, "%a, %a.%a %s Unsupported Redfish property da= ta type\n", __func__, Schema, Version, ConfigureLang)); --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109218): https://edk2.groups.io/g/devel/message/109218 Mute This Topic: https://groups.io/mt/101667461/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 14 01:15:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109219+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109219+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1696024764; cv=none; d=zohomail.com; s=zohoarc; b=L/GOU2lqLLQRscHxKf7DDTu3r2KHbicAxwddKaulMpGz+QCkvW6oefeqZL3B1maWtzipDANo/7eIemX7WA/cLB+1mQyNCH4SDxBaqVUpvc3RgMEZko3ScTzsLLizU7itjWr2DO8FQG140x1Ji7D6h748wGHO77fm95/ExygelYM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696024764; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=whVgHho+nv1LdSTIPSeAs80wpqitsuz1Fo20t+GSUT4=; b=QVTReaaszHyCW5sOx0EzXEz0IQHxWF/djxVLWuY5Ne5FMa3KVtLQxM+AtHvLMIPsfFzTk+3cgSmrkp95pK/nSm+nSGJoVCAYttZEje7WKULl+4gwR3cCHKI+qVBgfIRjuNG7dQ/hSW+SH56QgBZckvnDqqfUanG5UvsO/ScEsT0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109219+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1696024764939331.20333524642206; Fri, 29 Sep 2023 14:59:24 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=+ORURSf0ZTawdtB/TFug2BH5b5VUp0AZCwLdh4/I8FI=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1696024764; v=1; b=WJY0OG41T7AKaEAXoYsgA1vHJZ10Znt85CLmN7ZTG8eG1zkmqz37thsZd3YaM5l2Zo61KGX9 OJnYnj9IKni5auQ40LgsfSdIHhUHiYzTOwoFcsZOkvuN//Pos6hIB+AbIEIBpbHh38bnPjLffBX KpJJTfoldVlfeMXapZZwnEmM= X-Received: by 127.0.0.2 with SMTP id 4n1KYY1788612xbyoKBfKBld; Fri, 29 Sep 2023 14:59:24 -0700 X-Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by mx.groups.io with SMTP id smtpd.web11.30208.1696024763886428038 for ; Fri, 29 Sep 2023 14:59:24 -0700 X-Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2c186ea81c7so63003141fa.1 for ; Fri, 29 Sep 2023 14:59:23 -0700 (PDT) X-Gm-Message-State: wZceujLjivMdr6FWL4ZG0H2ax1787277AA= X-Google-Smtp-Source: AGHT+IGGKL12jK8ve2MtnqLbxPhCIedx74qsAtOzPZgL9+Y+GKrQ0x6mnyzsrLz9Y3r4gYImhujz1A== X-Received: by 2002:a05:651c:c6:b0:2bc:b0ae:a9e5 with SMTP id 6-20020a05651c00c600b002bcb0aea9e5mr5031472ljr.42.1696024761777; Fri, 29 Sep 2023 14:59:21 -0700 (PDT) X-Received: from localhost.localdomain ([185.9.78.108]) by smtp.gmail.com with ESMTPSA id y24-20020a2ebb98000000b002bfe8537f37sm890178lje.33.2023.09.29.14.59.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 29 Sep 2023 14:59:21 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 3/9] RedfishLib: remove redudant zeroing Date: Sat, 30 Sep 2023 00:59:09 +0300 Message-Id: <20230929215915.46616-4-mike.maslenkin@gmail.com> In-Reply-To: <20230929215915.46616-1-mike.maslenkin@gmail.com> References: <20230929215915.46616-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1696024767132100013 Content-Type: text/plain; charset="utf-8" Memory allocated by calloc() is filled with bytes of value zero. Signed-off-by: Mike Maslenkin Reviewed-by: Abner Chang --- .../PrivateLibrary/RedfishLib/edk2libredfish/src/service.c | 1 - 1 file changed, 1 deletion(-) diff --git a/RedfishClientPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/= service.c b/RedfishClientPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/s= ervice.c index a38bdfbea65f..0ffc23725d37 100644 --- a/RedfishClientPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service= .c +++ b/RedfishClientPkg/PrivateLibrary/RedfishLib/edk2libredfish/src/service= .c @@ -1773,7 +1773,6 @@ createServiceEnumeratorNoAuth ( char *HostStart; =20 ret =3D (redfishService *)calloc (1, sizeof (redfishService)); - ZeroMem (ret, sizeof (redfishService)); if (initRest (ret, restProtocol) !=3D 0) { free (ret); return NULL; --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109219): https://edk2.groups.io/g/devel/message/109219 Mute This Topic: https://groups.io/mt/101667462/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 14 01:15:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109220+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109220+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1696024765; cv=none; d=zohomail.com; s=zohoarc; b=PSnaUDPHRUOSEcjPZU57T+U/LwufpakO8ysoS2iGEDeulJyfJ8VZcPcUoP9gM7hzz4gn7lm8YD5vCZI5OvYRX+ce46GXSfiuHRVo4oiMEEt7liyhgLRirTlB2TGgb6rFg5J711Pkrmtr9syrrOFXPhf7pF8JipRChnur0y6B6jo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696024765; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=4DqicQDorf8Bbi4k9pOQDYJxY+dXK2Zz8twAOiVtZHk=; b=hZ7ZRloqFHDK2TX+QZCKDq5X8Aa7VpxdqefvqWsX1FjUjntnC5UaLkthsj/ylCy9kHzOiD6exdpbVXcHzLeZAT8V9zsyRJQzpZIBVNFAnjmUNrgcoVBz01S87OlDkQ/8WJJZhTeHazTn3tHdPQHxdXzVhHIEQE6dfFU04HY4Pxg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109220+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1696024765920933.5529632906912; Fri, 29 Sep 2023 14:59:25 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=EXzl7ylqunQyNthINMialDH+UOUBp9s6kCJoX/aC5mI=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1696024765; v=1; b=DK12q1B8MZfImpEBQHXSYXt5Mv1ZAXCuO6ETmdv5Z725boZaKrfDel18pmeuYmmACSDhdetw kPnJ8ZTXkGrUwE78AobYo0WAvAE7RK8e5NaMbEmyD8g+UWqloljqdT+xx43BpaZi1IrCCgeKiKi V9A4UATaFQufZDeAHYBSK6Pk= X-Received: by 127.0.0.2 with SMTP id o0QiYY1788612xeJFv9JSdEQ; Fri, 29 Sep 2023 14:59:25 -0700 X-Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) by mx.groups.io with SMTP id smtpd.web10.30358.1696024764648062168 for ; Fri, 29 Sep 2023 14:59:25 -0700 X-Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2c135cf2459so217796391fa.0 for ; Fri, 29 Sep 2023 14:59:24 -0700 (PDT) X-Gm-Message-State: p3e319du4XSH94LeDPxX8WNEx1787277AA= X-Google-Smtp-Source: AGHT+IE0RXCD+sb4eXMCxoNF/TkspElQ9WkUIowRxDq49tOECuS3f82TACDKE74+bE3UrQ/z/5x0Xw== X-Received: by 2002:a2e:a41a:0:b0:2c0:21b6:e80c with SMTP id p26-20020a2ea41a000000b002c021b6e80cmr5242466ljn.35.1696024762700; Fri, 29 Sep 2023 14:59:22 -0700 (PDT) X-Received: from localhost.localdomain ([185.9.78.108]) by smtp.gmail.com with ESMTPSA id y24-20020a2ebb98000000b002bfe8537f37sm890178lje.33.2023.09.29.14.59.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 29 Sep 2023 14:59:22 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 4/9] RedfishClientPkg: RedfishFeatureUtilityLib: fix memory leaks Date: Sat, 30 Sep 2023 00:59:10 +0300 Message-Id: <20230929215915.46616-5-mike.maslenkin@gmail.com> In-Reply-To: <20230929215915.46616-1-mike.maslenkin@gmail.com> References: <20230929215915.46616-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1696024767261100017 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mike Maslenkin Reviewed-by: Abner Chang --- .../RedfishFeatureUtilityLib.c | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatu= reUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishF= eatureUtilityLib.c index 35e342c817b7..8fa1dc2c3535 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c @@ -515,6 +515,7 @@ ApplyFeatureSettingsVagueType ( Status =3D UnicodeStrToAsciiStrS (ConfigureLang, ConfigureLangAscii, Str= Len (ConfigureLang) + 1); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, Convert the configureLang of vague key of %a= .%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); + FreePool (ConfigureLangAscii); return Status; } =20 @@ -1972,6 +1973,7 @@ RedfishGetUri ( // if (*Target =3D=3D '\0') { DEBUG ((DEBUG_ERROR, "%a, invalid format: %s\n", __func__, ConfigLan= g)); + FreePool (ResultStr); return NULL; } =20 @@ -1983,6 +1985,7 @@ RedfishGetUri ( TempStrSize =3D (ConfigLangLen - RemainingLen + 1) * sizeof (CHAR16); TempStr =3D AllocateCopyPool (TempStrSize, Head); if (TempStr =3D=3D NULL) { + FreePool (ResultStr); return NULL; } =20 @@ -1996,6 +1999,8 @@ RedfishGetUri ( ); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, Can not find: %s\n", __func__, TempStr)); + FreePool (ResultStr); + FreePool (TempStr); return NULL; } =20 @@ -2102,10 +2107,14 @@ GetConfigureLang ( =20 Status =3D AsciiStrToUnicodeStrS (Uri, UnicodeUri, StringSize); if (EFI_ERROR (Status)) { + FreePool (UnicodeUri); return NULL; } =20 ConfigLang =3D RedfishGetConfigLanguage (UnicodeUri); + + FreePool (UnicodeUri); + if (ConfigLang =3D=3D NULL) { return NULL; } @@ -2117,11 +2126,14 @@ GetConfigureLang ( StringSize =3D StrSize (ConfigLang) + ((AsciiStrLen (PropertyName) + 1) = * sizeof (CHAR16)); ResultStr =3D AllocatePool (StringSize); if (ResultStr =3D=3D NULL) { + FreePool (ConfigLang); return NULL; } =20 UnicodeSPrint (ResultStr, StringSize, L"%s/%a", ConfigLang, PropertyName= ); =20 + FreePool (ConfigLang); + return ResultStr; } =20 @@ -2296,9 +2308,12 @@ GetPropertyStringValue ( Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang= Buffer, &RedfishValue); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s failed: %= r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); + FreePool (ConfigureLangBuffer); return NULL; } =20 + FreePool (ConfigureLangBuffer); + if (RedfishValue.Type !=3D RedfishValueTypeString) { DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string type\n", __func= __, Schema, Version, ConfigureLang)); return NULL; @@ -2354,9 +2369,12 @@ GetPropertyNumericValue ( Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang= Buffer, &RedfishValue); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s failed: %= r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); + FreePool (ConfigureLangBuffer); return NULL; } =20 + FreePool (ConfigureLangBuffer); + if (RedfishValue.Type !=3D RedfishValueTypeInteger) { DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not numeric type\n", __fun= c__, Schema, Version, ConfigureLang)); return NULL; @@ -2416,9 +2434,12 @@ GetPropertyBooleanValue ( Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang= Buffer, &RedfishValue); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s failed: %= r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); + FreePool (ConfigureLangBuffer); return NULL; } =20 + FreePool (ConfigureLangBuffer); + if (RedfishValue.Type !=3D RedfishValueTypeBoolean) { DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not boolean type\n", __fun= c__, Schema, Version, ConfigureLang)); return NULL; @@ -2517,9 +2538,12 @@ GetPropertyStringArrayValue ( Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang= Buffer, &RedfishValue); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s failed: %= r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); + FreePool (ConfigureLangBuffer); return NULL; } =20 + FreePool (ConfigureLangBuffer); + if (RedfishValue.Type !=3D RedfishValueTypeStringArray) { DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n", = __func__, Schema, Version, ConfigureLang)); return NULL; @@ -2588,9 +2612,12 @@ GetPropertyNumericArrayValue ( Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang= Buffer, &RedfishValue); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s failed: %= r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); + FreePool (ConfigureLangBuffer); return NULL; } =20 + FreePool (ConfigureLangBuffer); + if (RedfishValue.Type !=3D RedfishValueTypeIntegerArray) { DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n", = __func__, Schema, Version, ConfigureLang)); return NULL; @@ -2659,9 +2686,12 @@ GetPropertyBooleanArrayValue ( Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang= Buffer, &RedfishValue); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s failed: %= r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); + FreePool (ConfigureLangBuffer); return NULL; } =20 + FreePool (ConfigureLangBuffer); + if (RedfishValue.Type !=3D RedfishValueTypeBooleanArray) { DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n", = __func__, Schema, Version, ConfigureLang)); return NULL; --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109220): https://edk2.groups.io/g/devel/message/109220 Mute This Topic: https://groups.io/mt/101667463/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 14 01:15:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109221+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109221+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1696024767; cv=none; d=zohomail.com; s=zohoarc; b=N1XsNBixKSJsNJZ2RW7Qcda+uJQR7lKMjRNx7x9hpdognUqXJAIZP5Vq36Dr9Lg7L2gh4/XxG8IBivjSGrfhBN9hE3PNsgANipuSHXVQWsuC3bANb9suICWDNpjlKZNaCCHGkgrDDPxvGSl2/qcLH2bvS05nra+JRPNRa2UUDoY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696024767; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=9jsrJ0D95zRVCLVI/70/7zoHL9RBBH48VrGE9W4fYb8=; b=iHFMmbRUjs5nFjTpf0ARcnyDceC6XCcFzFosjZLcKJxY7876GqgmWlH/zEcq8im7GdptCTBiq4eVrdx/ArjN8MtEafgqTK+rWL9xi3O2EP+6Sk2DUNP8ux7WNkETveCCSffEmYNGZq1LTKytzOcbG+7sRWgOWQGefVaBn+ySzKk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109221+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1696024767096114.6645346432955; Fri, 29 Sep 2023 14:59:27 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Uud86Q/Yndv5/ofJW0rnLyDiwvJBg+5D9LVykcjW5Mo=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1696024766; v=1; b=u7vnuJ1DErZdx+uX6lO2jq94lVPCPwmlvNof4sP4V+/qkUS9XQuolBdkb0FTJI4Wcye21K5F 6CF/l0UCgfSgmx9dKNAYPaI1qqNndpOssnMhhE3ZuOu+cP2ctXOet4FP8XueN3KbvjBbypjezw6 QTD1YacfaB9xxwASfUtnAQvI= X-Received: by 127.0.0.2 with SMTP id pIIuYY1788612x93MNqHEIf1; Fri, 29 Sep 2023 14:59:26 -0700 X-Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by mx.groups.io with SMTP id smtpd.web11.30210.1696024765873045513 for ; Fri, 29 Sep 2023 14:59:26 -0700 X-Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2c1807f3400so14349151fa.1 for ; Fri, 29 Sep 2023 14:59:25 -0700 (PDT) X-Gm-Message-State: HGtAt4vqRrcWMMLWIZQFBmWbx1787277AA= X-Google-Smtp-Source: AGHT+IEvgH6Ng0duhuO6steV5spWY7Nn39oS8USZjF4EVKuBrT2wLvz8340CNuvtlkLPQH1LVA5h2g== X-Received: by 2002:a2e:a28d:0:b0:2bd:1f0d:8c07 with SMTP id k13-20020a2ea28d000000b002bd1f0d8c07mr3782186lja.19.1696024763597; Fri, 29 Sep 2023 14:59:23 -0700 (PDT) X-Received: from localhost.localdomain ([185.9.78.108]) by smtp.gmail.com with ESMTPSA id y24-20020a2ebb98000000b002bfe8537f37sm890178lje.33.2023.09.29.14.59.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 29 Sep 2023 14:59:23 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 5/9] RedfishClientPkg: reduce identation level by adding early return Date: Sat, 30 Sep 2023 00:59:11 +0300 Message-Id: <20230929215915.46616-6-mike.maslenkin@gmail.com> In-Reply-To: <20230929215915.46616-1-mike.maslenkin@gmail.com> References: <20230929215915.46616-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1696024769317100025 Content-Type: text/plain; charset="utf-8" This functions contain memory leaks. Less identation helps to solve this issues. Signed-off-by: Mike Maslenkin Reviewed-by: Nickle Wang --- .../RedfishFeatureUtilityLib.c | 289 +++++++++--------- 1 file changed, 146 insertions(+), 143 deletions(-) diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatu= reUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishF= eatureUtilityLib.c index 8fa1dc2c3535..0941f33fd73a 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c @@ -763,68 +763,69 @@ ApplyFeatureSettingsStringArrayType ( Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang= , &RedfishValue); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __func__, Schema, Ve= rsion, ConfigureLang, Status)); - } else { - if (RedfishValue.Type !=3D RedfishValueTypeStringArray) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n"= , __func__, Schema, Version, ConfigureLang)); - return EFI_DEVICE_ERROR; - } + return Status; + } + + if (RedfishValue.Type !=3D RedfishValueTypeStringArray) { + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n", = __func__, Schema, Version, ConfigureLang)); + return EFI_DEVICE_ERROR; + } =20 + // + // If there is no change in array, do nothing + // + if (!CompareRedfishStringArrayValues (ArrayHead, RedfishValue.Value.Stri= ngArray, RedfishValue.ArrayCount)) { // - // If there is no change in array, do nothing + // Apply settings from redfish // - if (!CompareRedfishStringArrayValues (ArrayHead, RedfishValue.Value.St= ringArray, RedfishValue.ArrayCount)) { - // - // Apply settings from redfish - // - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", __fun= c__, Schema, Version, ConfigureLang)); - FreeArrayTypeRedfishValue (&RedfishValue); + DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", __func_= _, Schema, Version, ConfigureLang)); + FreeArrayTypeRedfishValue (&RedfishValue); =20 - // - // Convert array from RedfishCS_char_Array to EDKII_REDFISH_VALUE - // - RedfishValue.ArrayCount =3D 0; - Buffer =3D ArrayHead; - while (Buffer !=3D NULL) { - RedfishValue.ArrayCount +=3D 1; - Buffer =3D Buffer->Next; - } + // + // Convert array from RedfishCS_char_Array to EDKII_REDFISH_VALUE + // + RedfishValue.ArrayCount =3D 0; + Buffer =3D ArrayHead; + while (Buffer !=3D NULL) { + RedfishValue.ArrayCount +=3D 1; + Buffer =3D Buffer->Next; + } =20 - // - // Allocate pool for new values - // - RedfishValue.Value.StringArray =3D AllocatePool (RedfishValue.ArrayC= ount *sizeof (CHAR8 *)); - if (RedfishValue.Value.StringArray =3D=3D NULL) { + // + // Allocate pool for new values + // + RedfishValue.Value.StringArray =3D AllocatePool (RedfishValue.ArrayCou= nt *sizeof (CHAR8 *)); + if (RedfishValue.Value.StringArray =3D=3D NULL) { + ASSERT (FALSE); + return EFI_OUT_OF_RESOURCES; + } + + Buffer =3D ArrayHead; + Index =3D 0; + while (Buffer !=3D NULL) { + RedfishValue.Value.StringArray[Index] =3D AllocateCopyPool (AsciiStr= Size (Buffer->ArrayValue), Buffer->ArrayValue); + if (RedfishValue.Value.StringArray[Index] =3D=3D NULL) { ASSERT (FALSE); return EFI_OUT_OF_RESOURCES; } =20 - Buffer =3D ArrayHead; - Index =3D 0; - while (Buffer !=3D NULL) { - RedfishValue.Value.StringArray[Index] =3D AllocateCopyPool (AsciiS= trSize (Buffer->ArrayValue), Buffer->ArrayValue); - if (RedfishValue.Value.StringArray[Index] =3D=3D NULL) { - ASSERT (FALSE); - return EFI_OUT_OF_RESOURCES; - } - - Buffer =3D Buffer->Next; - Index++; - } + Buffer =3D Buffer->Next; + Index++; + } =20 - ASSERT (Index <=3D RedfishValue.ArrayCount); + ASSERT (Index <=3D RedfishValue.ArrayCount); =20 - Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configure= Lang, RedfishValue); - if (!EFI_ERROR (Status)) { - // - // Configuration changed. Enable system reboot flag. - // - REDFISH_ENABLE_SYSTEM_REBOOT (); - } else { - DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__, = ConfigureLang, Status)); - } + Status =3D RedfishPlatformConfigSetValue (Schema, Version, ConfigureLa= ng, RedfishValue); + if (!EFI_ERROR (Status)) { + // + // Configuration changed. Enable system reboot flag. + // + REDFISH_ENABLE_SYSTEM_REBOOT (); } else { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __f= unc__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__, Co= nfigureLang, Status)); } + } else { + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __fun= c__, Schema, Version, ConfigureLang)); } =20 return Status; @@ -866,63 +867,64 @@ ApplyFeatureSettingsNumericArrayType ( Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang= , &RedfishValue); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __func__, Schema, Ve= rsion, ConfigureLang, Status)); - } else { - if (RedfishValue.Type !=3D RedfishValueTypeIntegerArray) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n"= , __func__, Schema, Version, ConfigureLang)); - return EFI_DEVICE_ERROR; - } + return Status; + } + + if (RedfishValue.Type !=3D RedfishValueTypeIntegerArray) { + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n", = __func__, Schema, Version, ConfigureLang)); + return EFI_DEVICE_ERROR; + } =20 + // + // If there is no change in array, do nothing + // + if (!CompareRedfishNumericArrayValues (ArrayHead, RedfishValue.Value.Int= egerArray, RedfishValue.ArrayCount)) { // - // If there is no change in array, do nothing + // Apply settings from redfish // - if (!CompareRedfishNumericArrayValues (ArrayHead, RedfishValue.Value.I= ntegerArray, RedfishValue.ArrayCount)) { - // - // Apply settings from redfish - // - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", __fun= c__, Schema, Version, ConfigureLang)); - FreeArrayTypeRedfishValue (&RedfishValue); + DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", __func_= _, Schema, Version, ConfigureLang)); + FreeArrayTypeRedfishValue (&RedfishValue); =20 - // - // Convert array from RedfishCS_int64_Array to EDKII_REDFISH_VALUE - // - RedfishValue.ArrayCount =3D 0; - Buffer =3D ArrayHead; - while (Buffer !=3D NULL) { - RedfishValue.ArrayCount +=3D 1; - Buffer =3D Buffer->Next; - } + // + // Convert array from RedfishCS_int64_Array to EDKII_REDFISH_VALUE + // + RedfishValue.ArrayCount =3D 0; + Buffer =3D ArrayHead; + while (Buffer !=3D NULL) { + RedfishValue.ArrayCount +=3D 1; + Buffer =3D Buffer->Next; + } =20 - // - // Allocate pool for new values - // - RedfishValue.Value.IntegerArray =3D AllocatePool (RedfishValue.Array= Count * sizeof (INT64)); - if (RedfishValue.Value.IntegerArray =3D=3D NULL) { - ASSERT (FALSE); - return EFI_OUT_OF_RESOURCES; - } + // + // Allocate pool for new values + // + RedfishValue.Value.IntegerArray =3D AllocatePool (RedfishValue.ArrayCo= unt * sizeof (INT64)); + if (RedfishValue.Value.IntegerArray =3D=3D NULL) { + ASSERT (FALSE); + return EFI_OUT_OF_RESOURCES; + } =20 - Buffer =3D ArrayHead; - Index =3D 0; - while (Buffer !=3D NULL) { - RedfishValue.Value.IntegerArray[Index] =3D (INT64)*Buffer->ArrayVa= lue; - Buffer =3D Buffer->Next; - Index++; - } + Buffer =3D ArrayHead; + Index =3D 0; + while (Buffer !=3D NULL) { + RedfishValue.Value.IntegerArray[Index] =3D (INT64)*Buffer->ArrayValu= e; + Buffer =3D Buffer->Next; + Index++; + } =20 - ASSERT (Index <=3D RedfishValue.ArrayCount); + ASSERT (Index <=3D RedfishValue.ArrayCount); =20 - Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configure= Lang, RedfishValue); - if (!EFI_ERROR (Status)) { - // - // Configuration changed. Enable system reboot flag. - // - REDFISH_ENABLE_SYSTEM_REBOOT (); - } else { - DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__, = ConfigureLang, Status)); - } + Status =3D RedfishPlatformConfigSetValue (Schema, Version, ConfigureLa= ng, RedfishValue); + if (!EFI_ERROR (Status)) { + // + // Configuration changed. Enable system reboot flag. + // + REDFISH_ENABLE_SYSTEM_REBOOT (); } else { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __f= unc__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__, Co= nfigureLang, Status)); } + } else { + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __fun= c__, Schema, Version, ConfigureLang)); } =20 return Status; @@ -964,63 +966,64 @@ ApplyFeatureSettingsBooleanArrayType ( Status =3D RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang= , &RedfishValue); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __func__, Schema, Ve= rsion, ConfigureLang, Status)); - } else { - if (RedfishValue.Type !=3D RedfishValueTypeBooleanArray) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n"= , __func__, Schema, Version, ConfigureLang)); - return EFI_DEVICE_ERROR; - } + return Status; + } + + if (RedfishValue.Type !=3D RedfishValueTypeBooleanArray) { + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n", = __func__, Schema, Version, ConfigureLang)); + return EFI_DEVICE_ERROR; + } =20 + // + // If there is no change in array, do nothing + // + if (!CompareRedfishBooleanArrayValues (ArrayHead, RedfishValue.Value.Boo= leanArray, RedfishValue.ArrayCount)) { // - // If there is no change in array, do nothing + // Apply settings from redfish // - if (!CompareRedfishBooleanArrayValues (ArrayHead, RedfishValue.Value.B= ooleanArray, RedfishValue.ArrayCount)) { - // - // Apply settings from redfish - // - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", __fun= c__, Schema, Version, ConfigureLang)); - FreeArrayTypeRedfishValue (&RedfishValue); + DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", __func_= _, Schema, Version, ConfigureLang)); + FreeArrayTypeRedfishValue (&RedfishValue); =20 - // - // Convert array from RedfishCS_int64_Array to EDKII_REDFISH_VALUE - // - RedfishValue.ArrayCount =3D 0; - Buffer =3D ArrayHead; - while (Buffer !=3D NULL) { - RedfishValue.ArrayCount +=3D 1; - Buffer =3D Buffer->Next; - } + // + // Convert array from RedfishCS_int64_Array to EDKII_REDFISH_VALUE + // + RedfishValue.ArrayCount =3D 0; + Buffer =3D ArrayHead; + while (Buffer !=3D NULL) { + RedfishValue.ArrayCount +=3D 1; + Buffer =3D Buffer->Next; + } =20 - // - // Allocate pool for new values - // - RedfishValue.Value.BooleanArray =3D AllocatePool (RedfishValue.Array= Count * sizeof (BOOLEAN)); - if (RedfishValue.Value.BooleanArray =3D=3D NULL) { - ASSERT (FALSE); - return EFI_OUT_OF_RESOURCES; - } + // + // Allocate pool for new values + // + RedfishValue.Value.BooleanArray =3D AllocatePool (RedfishValue.ArrayCo= unt * sizeof (BOOLEAN)); + if (RedfishValue.Value.BooleanArray =3D=3D NULL) { + ASSERT (FALSE); + return EFI_OUT_OF_RESOURCES; + } =20 - Buffer =3D ArrayHead; - Index =3D 0; - while (Buffer !=3D NULL) { - RedfishValue.Value.BooleanArray[Index] =3D (BOOLEAN)*Buffer->Array= Value; - Buffer =3D Buffer->Next; - Index++; - } + Buffer =3D ArrayHead; + Index =3D 0; + while (Buffer !=3D NULL) { + RedfishValue.Value.BooleanArray[Index] =3D (BOOLEAN)*Buffer->ArrayVa= lue; + Buffer =3D Buffer->Next; + Index++; + } =20 - ASSERT (Index <=3D RedfishValue.ArrayCount); + ASSERT (Index <=3D RedfishValue.ArrayCount); =20 - Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configure= Lang, RedfishValue); - if (!EFI_ERROR (Status)) { - // - // Configuration changed. Enable system reboot flag. - // - REDFISH_ENABLE_SYSTEM_REBOOT (); - } else { - DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__, = ConfigureLang, Status)); - } + Status =3D RedfishPlatformConfigSetValue (Schema, Version, ConfigureLa= ng, RedfishValue); + if (!EFI_ERROR (Status)) { + // + // Configuration changed. Enable system reboot flag. + // + REDFISH_ENABLE_SYSTEM_REBOOT (); } else { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __f= unc__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__, Co= nfigureLang, Status)); } + } else { + DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __fun= c__, Schema, Version, ConfigureLang)); } =20 return Status; --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109221): https://edk2.groups.io/g/devel/message/109221 Mute This Topic: https://groups.io/mt/101667464/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 14 01:15:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109222+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109222+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1696024767; cv=none; d=zohomail.com; s=zohoarc; b=NcDUsyYFXnkl3tB/h4vrSIyetFugxo7js2iQI6bI/djg1IdFGhpubYSeyOBv04tmKV/YRln+cO8jkU6ylUnB+Zro6rx+lwt68Y/6s7es7+hJq/+MoH4mjKiGFwQX7ZLE4c2JGref+GiYxZDl+LQ+CCXRLWHvAYgNVYHwoSbpa3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696024767; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=5iIVmzA5RouWrCghPfxbgpjsCuhdeGNJtMy6h97McbU=; b=Xt/ow+GxAE9czA66XZ+mo1L304USrQlva4tMv+ULBOLBEI61d5RyM9DYOPJwi5SsvyyzSa6Ua/maeTJuFh0LH2h9SNsQoawRUya21fbDgvLWEYiLRZ3GncAJVqvGM4VRg6+jC+3CM5M+3Mh/Btitu1Qon0wddV0+bvzmkJQSidc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109222+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1696024767774195.97958424484784; Fri, 29 Sep 2023 14:59:27 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=dkCD8l9eXXR6iRa67Qk7b6OnQ3O5BsWPI72MGU98ivg=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1696024767; v=1; b=aPOxMJAIVvytra+prrBoAIizwSEcY316QFZKyWiDMr0WESZNGQRm97oD2fD2BfWZwu7Bs7re vnMk9B2yFMNwe0uZOeD4GbtxAS1GbXNRwyfv1LMgVCGHs4OTFwhD2XuteLOGLt+W59MFZeso6bH 6hJossCAXJOFcsxZHjaysITI= X-Received: by 127.0.0.2 with SMTP id yDCMYY1788612xsbUTRYySam; Fri, 29 Sep 2023 14:59:27 -0700 X-Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.groups.io with SMTP id smtpd.web11.30211.1696024766680086208 for ; Fri, 29 Sep 2023 14:59:26 -0700 X-Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-32329d935d4so9318818f8f.2 for ; Fri, 29 Sep 2023 14:59:26 -0700 (PDT) X-Gm-Message-State: kfMO67jitoMCpLyrRnhvpbhdx1787277AA= X-Google-Smtp-Source: AGHT+IHprW53UEL5BiiUKqn9jal9UKNQ/O+nrAgWbXemq29HyQfU5GquX/8bYxOMD5HXdZxzoDP0nw== X-Received: by 2002:a5d:5602:0:b0:323:33b1:dc44 with SMTP id l2-20020a5d5602000000b0032333b1dc44mr4792583wrv.0.1696024764578; Fri, 29 Sep 2023 14:59:24 -0700 (PDT) X-Received: from localhost.localdomain ([185.9.78.108]) by smtp.gmail.com with ESMTPSA id y24-20020a2ebb98000000b002bfe8537f37sm890178lje.33.2023.09.29.14.59.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 29 Sep 2023 14:59:24 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 6/9] RedfishClientPkg: fix memory leaks while applying feature settings Date: Sat, 30 Sep 2023 00:59:12 +0300 Message-Id: <20230929215915.46616-7-mike.maslenkin@gmail.com> In-Reply-To: <20230929215915.46616-1-mike.maslenkin@gmail.com> References: <20230929215915.46616-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1696024768361100021 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mike Maslenkin Reviewed-by: Abner Chang --- .../RedfishFeatureUtilityLib.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatu= reUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishF= eatureUtilityLib.c index 0941f33fd73a..e189987850f7 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c @@ -806,6 +806,7 @@ ApplyFeatureSettingsStringArrayType ( RedfishValue.Value.StringArray[Index] =3D AllocateCopyPool (AsciiStr= Size (Buffer->ArrayValue), Buffer->ArrayValue); if (RedfishValue.Value.StringArray[Index] =3D=3D NULL) { ASSERT (FALSE); + FreePool (RedfishValue.Value.StringArray); return EFI_OUT_OF_RESOURCES; } =20 @@ -828,6 +829,12 @@ ApplyFeatureSettingsStringArrayType ( DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __fun= c__, Schema, Version, ConfigureLang)); } =20 + for (Index =3D 0; Index < RedfishValue.ArrayCount; Index++) { + FreePool (RedfishValue.Value.StringArray[Index]); + } + + FreePool (RedfishValue.Value.StringArray); + return Status; } =20 @@ -927,6 +934,8 @@ ApplyFeatureSettingsNumericArrayType ( DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __fun= c__, Schema, Version, ConfigureLang)); } =20 + FreePool (RedfishValue.Value.IntegerArray); + return Status; } =20 @@ -1026,6 +1035,8 @@ ApplyFeatureSettingsBooleanArrayType ( DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __fun= c__, Schema, Version, ConfigureLang)); } =20 + FreePool (RedfishValue.Value.BooleanArray); + return Status; } =20 --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109222): https://edk2.groups.io/g/devel/message/109222 Mute This Topic: https://groups.io/mt/101667465/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 14 01:15:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109223+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109223+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1696024768; cv=none; d=zohomail.com; s=zohoarc; b=Jrx4bWuPD88sjC4ZZWbE1DhgsYxn3u81Nz+E+WsD+/mK6CymnPf4ab4DaDse1OaBPELwkpQVi8b72BxSkeDf6WnHllSYtygtQ2ds6XnbVoyf8QoA97lTJEyKOUpg+d48aWoDKkY5wTtpAGkxrtMcKc5uRArDJJv9UwWFPRziFZw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696024768; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=PVBobnRyx+rgz04s1ZXnp0dJ/WxIp5uOc1NrL0o2hF0=; b=cH2gO0Nuu31ic1D5gx5fDS1vWcjH5VzgeEpecanthSq5kgDZolCmcAjBslwStN0siDxPEswx2h73Pe9edDa23VYupItt14M8p4X3Xx9vvCS7mI96w57FTBA167NHjK1SgExaAA4QUPCbDrqN2JlSrAoIQggtYoXP3O1OfTLYShI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109223+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1696024768457465.8968239167841; Fri, 29 Sep 2023 14:59:28 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=6uYWSUzWqyA6pJlwdNWKNwteP9+q49gy6OOb6KFJUuI=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1696024768; v=1; b=mAMy+sWpMqoaRNZoVWk47TPezdhcLJAdRyulprGSAysvdd+d/UcY2cDmSy7u3qvBieOnKwdK EZrO/2WEsMKaTb5uIvyzoivYPIKuFGhPWHmta+3h/xfgix4ZdVnEeR1mqG+DCFEdG/30sdD8gqi lzaiqiqYsNOKuGNwUzwqFia0= X-Received: by 127.0.0.2 with SMTP id o8QxYY1788612xD5ECSwvtBU; Fri, 29 Sep 2023 14:59:28 -0700 X-Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mx.groups.io with SMTP id smtpd.web10.30359.1696024767354344852 for ; Fri, 29 Sep 2023 14:59:27 -0700 X-Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2c17de836fbso92225861fa.1 for ; Fri, 29 Sep 2023 14:59:27 -0700 (PDT) X-Gm-Message-State: jdjq38vA3WkzxaQBr2JHtbjBx1787277AA= X-Google-Smtp-Source: AGHT+IFq1EgwkU9IdIzccJ9z3BJUNOSJzDTLtRUzUW4WWN27nQZEYTffssBdZMbC2kXmL0KA5/uObg== X-Received: by 2002:a2e:93d6:0:b0:2c0:2ab7:9ab5 with SMTP id p22-20020a2e93d6000000b002c02ab79ab5mr4630600ljh.12.1696024765528; Fri, 29 Sep 2023 14:59:25 -0700 (PDT) X-Received: from localhost.localdomain ([185.9.78.108]) by smtp.gmail.com with ESMTPSA id y24-20020a2ebb98000000b002bfe8537f37sm890178lje.33.2023.09.29.14.59.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 29 Sep 2023 14:59:25 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 7/9] RedfishClientPkg: fix memory leak Date: Sat, 30 Sep 2023 00:59:13 +0300 Message-Id: <20230929215915.46616-8-mike.maslenkin@gmail.com> In-Reply-To: <20230929215915.46616-1-mike.maslenkin@gmail.com> References: <20230929215915.46616-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1696024769964100031 Content-Type: text/plain; charset="utf-8" This patch fixes leak in RedfishExternalResourceResourceFeatureCallback function. Signed-off-by: Mike Maslenkin Reviewed-by: Abner Chang --- RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c b/RedfishC= lientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c index 32dca964aa0a..9b336d3de479 100644 --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c @@ -718,6 +718,7 @@ RedfishExternalResourceResourceFeatureCallback ( Private->Uri =3D RedfishGetUri (ResourceUri); if (Private->Uri =3D=3D NULL) { ASSERT (FALSE); + FreePool (ResourceUri); return EFI_OUT_OF_RESOURCES; } =20 @@ -727,6 +728,7 @@ RedfishExternalResourceResourceFeatureCallback ( } =20 FreePool (Private->Uri); + FreePool (ResourceUri); return Status; } =20 --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109223): https://edk2.groups.io/g/devel/message/109223 Mute This Topic: https://groups.io/mt/101667467/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 14 01:15:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109224+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109224+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1696024769; cv=none; d=zohomail.com; s=zohoarc; b=l7L48JKZjXpTi/QEhgqOvAENfSyMUytxack6br3qWM+zkC8TxuwgtqbgIQfAAZcSCK31sz/q5ER7tsFUtBoTD38cEnVlNR+9rvp8BjsRYYOINiw/FK3KxwhhaXA21HlVP1sKtBlJANpatER1RF6Sjb2zrI8bLL0dLw8QnbvBYxM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696024769; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=RPrM+bzlzny5mFaBdGy/BsbN1BvbVZzBmeKlnGL1Uho=; b=FqDPfHWvgvAPyH5rEU9thuLtKOSC83+OOigSV0fCyby3IlM3c87p7+MPftsyZKqToARX3zkGLDtmMKrBmqCpA9uKvCxGr6UnQwm1YrEzFZwiOhM/3uDujHjKps8FAMF8YowUQcS6w0up/LBbwc0hRhJAGNETIvGSkfPCSgtiWWE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109224+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 169602476956422.901032689930048; Fri, 29 Sep 2023 14:59:29 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=lYSumSRCNjyxCNn5NM01+WYyw9Uo4h/GwoFFwEyoajo=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1696024769; v=1; b=CTuoRXAhTXe0Hr+vpO+xQU68ZpaOnPLzQQw0cR0GpArRyssTW4L14Mpo8Ar2g4nCUzeLyUJo f1pDKfkAZ/1jOHLuni6x0Ub39eYaz1reJuF5prIHjxgA0xA7QCfngfarfbllm62t0HGTX5ayRGA carSR16G2WV0bu8D482a7flo= X-Received: by 127.0.0.2 with SMTP id 4OrTYY1788612xBJWy8ntmtH; Fri, 29 Sep 2023 14:59:29 -0700 X-Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by mx.groups.io with SMTP id smtpd.web10.30360.1696024768456297219 for ; Fri, 29 Sep 2023 14:59:28 -0700 X-Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2c131ddfc95so225981361fa.0 for ; Fri, 29 Sep 2023 14:59:28 -0700 (PDT) X-Gm-Message-State: 9OeqBgd8NvL2nOhFTy82524Jx1787277AA= X-Google-Smtp-Source: AGHT+IG0Y7XEDmDheJuBddsbUcaevWp5f7I55hTDqWyAFp0bYF74cz+t/gBF4a+uq3R9BckdQ3uM4w== X-Received: by 2002:a2e:a16d:0:b0:2b6:e958:5700 with SMTP id u13-20020a2ea16d000000b002b6e9585700mr4812727ljl.4.1696024766521; Fri, 29 Sep 2023 14:59:26 -0700 (PDT) X-Received: from localhost.localdomain ([185.9.78.108]) by smtp.gmail.com with ESMTPSA id y24-20020a2ebb98000000b002bfe8537f37sm890178lje.33.2023.09.29.14.59.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 29 Sep 2023 14:59:26 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 8/9] RedfishClientPkg: fix pragma pack usage Date: Sat, 30 Sep 2023 00:59:14 +0300 Message-Id: <20230929215915.46616-9-mike.maslenkin@gmail.com> In-Reply-To: <20230929215915.46616-1-mike.maslenkin@gmail.com> References: <20230929215915.46616-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1696024771164100035 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mike Maslenkin Reviewed-by: Abner Chang Reviewed-by: Nickle Wang --- RedfishClientPkg/HiiToRedfishBiosDxe/HiiToRedfishBiosData.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RedfishClientPkg/HiiToRedfishBiosDxe/HiiToRedfishBiosData.h b/= RedfishClientPkg/HiiToRedfishBiosDxe/HiiToRedfishBiosData.h index 7e1bc9cefbac..9d5b10a7e909 100644 --- a/RedfishClientPkg/HiiToRedfishBiosDxe/HiiToRedfishBiosData.h +++ b/RedfishClientPkg/HiiToRedfishBiosDxe/HiiToRedfishBiosData.h @@ -31,7 +31,7 @@ extern EFI_GUID gHiiToRedfishBiosFormsetGuid; #define ID_STRING_MAX 15 #define ID_STRING_MAX_WITH_TERMINATOR 16 =20 -#pragma pack() +#pragma pack(1) =20 // // Definiton of HII_TO_REDFISH_BIOS_VARSTORE_DATA @@ -44,4 +44,5 @@ typedef struct { UINT8 Reserved; } HII_TO_REDFISH_BIOS_EFI_VARSTORE_DATA; =20 +#pragma pack() #endif --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109224): https://edk2.groups.io/g/devel/message/109224 Mute This Topic: https://groups.io/mt/101667468/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 14 01:15:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109225+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109225+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1696024770; cv=none; d=zohomail.com; s=zohoarc; b=LAUIalcE2tJ01kZylIrLqEyJFNSSSL5Qgp9P0N3IrehER68dNKZcYubm5kh9GZ0/E328UK05xO000Szg1VCqe4/9SQZlFBmZxBhNWbCQ6ArJSxTOkcM863QU0d1xc9qk1P6ouMfbVON+ct1d3oSp2uIfWGMRu4HQlChKSMAicWE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696024770; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=UADRklzqzqApPVOcYAEnVJiZKsoqAcD5+YKEasVIpCM=; b=B8dLbMzPDugJA5isAMQJRNNa/iU9qZOc2bD+WNm4rM1GTD5oncvomVIuMrrjbNWUZq2SQEveQecfTUxgoW+hq1KiQoNsYgpcfBLzHHE8+U2p4vFjpQJ/tet+lFCHyJUEJBEgZGphEHBf+m/u2aBiY7+qtr2jqzA4ZXfSSaeYQmM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109225+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1696024770377919.9806085653712; Fri, 29 Sep 2023 14:59:30 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Cs3UQiT7asM6+XRTmDCuh9Nmsk2zWbyaZQtrFkoPOJU=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1696024770; v=1; b=RaQEyoJaJqHTE5eASFetM+IQJ+BpmEoqHvHnAR6OLW+VYsQUgdddKROLh1NGfY0SEKADoyRY fagtUfKEsxZ8+GPQVshvHCapmxYR23F5y42oDTpoajSy69JoB2wzep78FOn2J14FTnrEN+JUb0R lMa4DbzhTSgEtr3irY08DFuU= X-Received: by 127.0.0.2 with SMTP id 2iutYY1788612x19H0KSit4R; Fri, 29 Sep 2023 14:59:30 -0700 X-Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by mx.groups.io with SMTP id smtpd.web10.30362.1696024769281613038 for ; Fri, 29 Sep 2023 14:59:29 -0700 X-Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2c131ddfc95so225981431fa.0 for ; Fri, 29 Sep 2023 14:59:29 -0700 (PDT) X-Gm-Message-State: Kp0WNDxDwR4Li34geOnBPw05x1787277AA= X-Google-Smtp-Source: AGHT+IErILYGhDw2UJziiR968sM5sdSC57ugFn/DzWHgrx/gD1VpPrXUPEJaGCuhR4l7z+QXPoGVdg== X-Received: by 2002:a2e:9214:0:b0:2bc:b88c:64ed with SMTP id k20-20020a2e9214000000b002bcb88c64edmr4982410ljg.12.1696024767422; Fri, 29 Sep 2023 14:59:27 -0700 (PDT) X-Received: from localhost.localdomain ([185.9.78.108]) by smtp.gmail.com with ESMTPSA id y24-20020a2ebb98000000b002bfe8537f37sm890178lje.33.2023.09.29.14.59.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 29 Sep 2023 14:59:27 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 9/9] RedfishClientPkg: fix StrnCpyS arguments Date: Sat, 30 Sep 2023 00:59:15 +0300 Message-Id: <20230929215915.46616-10-mike.maslenkin@gmail.com> In-Reply-To: <20230929215915.46616-1-mike.maslenkin@gmail.com> References: <20230929215915.46616-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1696024771321100039 Content-Type: text/plain; charset="utf-8" StrnCpyS accepts string length in characters, not in bytes. Signed-off-by: Mike Maslenkin --- RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c= b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c index 8ac165dec59e..c19d4a46d6af 100644 --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c @@ -331,7 +331,7 @@ NewInternalInstance ( } =20 NewInternalData->NodeName =3D AllocateZeroPool (StrSize (NodeName)); - StrnCpyS (NewInternalData->NodeName, StrSize (NodeName), (CONST CHAR16 *= )NodeName, StrLen (NodeName)); + StrnCpyS (NewInternalData->NodeName, StrLen (NodeName) + 1, (CONST CHAR1= 6 *)NodeName, StrLen (NodeName)); NewInternalData->SiblingList =3D NULL; NewInternalData->ChildList =3D NULL; if (NodeIsCollection) { --=20 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109225): https://edk2.groups.io/g/devel/message/109225 Mute This Topic: https://groups.io/mt/101667469/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-