From nobody Wed May 15 15:22:20 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+110146+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+110146+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698364441; cv=none; d=zohomail.com; s=zohoarc; b=HUTYykvVPrg9uEINnOBfNiG6zGQirtz6wTpFfB43M6dYePJxHbeekbhIQnAn9mO1LEjoeCtqeLquSqQ079C7a9f5EBohiEOI/kMrmaMYCmi4TYqzY5F/R/xnbaamesxxp6mtaX8s+x1nqbWIpAM3yclgzJDGn3EweQgdJkviY5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698364441; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=iE2Jv6QHjoDFfVtNLGPGl24fxlwM5ugODAhcCe+f2ck=; b=WAsbvZEn0y3nqsOcdpszeur39Axt6vkBIXJTet3xbM+rV2W1j7B3JRNlP4qZgoqv5lW+pNuztDyQwB08WEEYWHCqMmaQ+VrivvLBIjmzWuQU3rNy1uCERh8ccNmSyW4Fp8b61iUuxnPel2APTieXtqu77pbv2bX/8a2WJBmIoz8= 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+110146+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 1698364441256668.5975753791722; Thu, 26 Oct 2023 16:54:01 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=qmGK8UYKXWzEvVnUainO0tSnYwXhjdffsdMGuoJSeSQ=; 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=1698364440; v=1; b=gC6pv5r7G7qDkZxGqIhrbX3xS1bvKRY5zV+MkKibPPaiV4vM+oqZ/uUhy+qn8QFschTNrT/c 1xCF6GFSCUOw5uAa3jYJ2C2oVhKH6RjQC7qOe8d36xme3gFwkAs27XIfYs0KFugyt6tzvhUlW0P 0vCbY3ziw2K1c7H3w+ywg1ak= X-Received: by 127.0.0.2 with SMTP id bJBQYY1788612xAMPhl5rQUG; Thu, 26 Oct 2023 16:54:00 -0700 X-Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by mx.groups.io with SMTP id smtpd.web11.86061.1698364439947794533 for ; Thu, 26 Oct 2023 16:54:00 -0700 X-Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-507a98517f3so2047750e87.0 for ; Thu, 26 Oct 2023 16:53:59 -0700 (PDT) X-Gm-Message-State: Ex8Lud6EB7tzUCqEkq45LTbtx1787277AA= X-Google-Smtp-Source: AGHT+IFQNZnimmRuFE+BjN1DakzI9XCbn9apVavJXbbSk6JtX6Tq/ZT66n1CwnwDI08sgKk6mV9BBg== X-Received: by 2002:a19:6416:0:b0:507:9fc1:ca7e with SMTP id y22-20020a196416000000b005079fc1ca7emr516702lfb.51.1698364437974; Thu, 26 Oct 2023 16:53:57 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u8-20020a056512040800b00507a8789b43sm39389lfk.269.2023.10.26.16.53.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 16:53:57 -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] [edk2-redfish-client][PATCH v2 01/11] RedfishClientPkg: fix format used for output __func__ Date: Fri, 27 Oct 2023 02:53:44 +0300 Message-Id: <20231026235354.67625-2-mike.maslenkin@gmail.com> In-Reply-To: <20231026235354.67625-1-mike.maslenkin@gmail.com> References: <20231026235354.67625-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: 1698364441578100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mike Maslenkin Reviewed-by: Nickle Wang --- 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 (#110146): https://edk2.groups.io/g/devel/message/110146 Mute This Topic: https://groups.io/mt/102211770/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 Wed May 15 15:22:20 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+110147+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+110147+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698364442; cv=none; d=zohomail.com; s=zohoarc; b=BqTCWmIpji3p/QYvor2eso9fQ09Uavxc5LwaNINOICLZqq9NUQhwpfNxqvUk1Jw5qbXlgB+NSk0Yn7huPDwpUVHvPS25FSXCHH6KsJesnjM7qUB2rzJGgensl5DJaBH6q3FFak5KUYDbLIxw1ZDz8YRTiE+Bi0vFH/2NNuh7Dio= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698364442; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=SoNiThvW9bWsLwTdnI8/Ah+fzwi7Bt5lBBIWTuuLywQ=; b=V7oS4UF+qaf5wgEd1cN46Pk0YEnIq7i8bcRSFYjCcm7WRHsTkqAkhDkfEIklm0sX+n8DhPdl8f/vmVgNkWpK42bIoOgRtV2sJgTjX0bvkW8AdtNzvVI2rLzfsmenmdP7gJebB7h3NHwcz29Sa/qBzqnrECp5UDMNyETwpLo4iL4= 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+110147+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 1698364442122895.8591602123456; Thu, 26 Oct 2023 16:54:02 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=JsMEsc8l3ZzQE46xzz5zh1NYkhE7+vE4wn3FDIpZxXI=; 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=1698364441; v=1; b=NNwZmUSEn1M8NPA+MwEzlVQLpzdnLgUV2a9QwA6VSGKaqZ9Kq4U/CyKo4hycwAyoY4VoKIH1 DvxGu5Ye9I4J4TkU9m+7MMiC93QI5nFGnsjUbMgOiI7nxtJT2HCexYAfnfULPHnexYULKXEU4hW Vv2JMERDvwq1YFGcJ23Qzz60= X-Received: by 127.0.0.2 with SMTP id gF0DYY1788612x6rgIySSo7V; Thu, 26 Oct 2023 16:54:01 -0700 X-Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mx.groups.io with SMTP id smtpd.web11.86062.1698364440947999839 for ; Thu, 26 Oct 2023 16:54:01 -0700 X-Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-5082a874098so12014e87.3 for ; Thu, 26 Oct 2023 16:54:00 -0700 (PDT) X-Gm-Message-State: lZ8y5soVlqK9UbqGXutZ9aHUx1787277AA= X-Google-Smtp-Source: AGHT+IHpXVIw5kBJxz1ehmunxSX7P/syGP0GGFwyjXKxDUsPWCqErKbiJtkriIFmSp/jmaUtTBi8ww== X-Received: by 2002:a05:6512:10cb:b0:507:aaa9:b080 with SMTP id k11-20020a05651210cb00b00507aaa9b080mr726626lfg.33.1698364438678; Thu, 26 Oct 2023 16:53:58 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u8-20020a056512040800b00507a8789b43sm39389lfk.269.2023.10.26.16.53.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 16:53:58 -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] [edk2-redfish-client][PATCH v2 02/11] RedfishClientPkg: fix DEBUG macro arguments Date: Fri, 27 Oct 2023 02:53:45 +0300 Message-Id: <20231026235354.67625-3-mike.maslenkin@gmail.com> In-Reply-To: <20231026235354.67625-1-mike.maslenkin@gmail.com> References: <20231026235354.67625-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: 1698364443646100013 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mike Maslenkin Reviewed-by: Nickle Wang --- .../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 (#110147): https://edk2.groups.io/g/devel/message/110147 Mute This Topic: https://groups.io/mt/102211771/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 Wed May 15 15:22:20 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+110148+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+110148+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698364442; cv=none; d=zohomail.com; s=zohoarc; b=LA/pBwugbWant+ySACffYw4qxGWkPoGDTmpkNKVbUZR7Vu4YcisDcxcOHhcczzmE+BfhEJPsJ1hHoGiWyObXyOVW8U3yKKrFXErdNeib5XtoIQjXvNni12b1IeL0i+j6ncLX7cbPIvoNSdRJSxWr+CR9AXtD6AmHYnJo51+GjQw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698364442; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=G1W3qAliZnJPEINbXOeC0StOPDptchAMxyv8sccRq+U=; b=ZQj+00rqyz2SABIESVmlcIctUDKaxXNiQap/mNMKRM3i1Tocm6SvfaK54LnURM3obJLQlG24FlRmz4mvdoK7HtVeIHlLPn2ILBslNDpLhUOvH7RTaicJJNNAV9xTn79/hu3zU68VIvoEVBXmIKDddNzpSfEC/sYNkl5tTcvyyMI= 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+110148+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 1698364442587577.4567119756126; Thu, 26 Oct 2023 16:54:02 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=hZDKMb7ZnAGcY560LAHEXgK3mnJ9wq2/j4IRyZxX9Gc=; 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=1698364442; v=1; b=Hs0Z+oZYZnMl8Ok6X64Gr1yxjNRDlvlXX5G5+6F4FYDf/TgYlRKNEt2rTnWo126nWF2vrcaa ZT9g0CR8BOATAz52Uc7FANihS9CsANvtQ0L82QzfRsKFZ7mtLTc/vIAJnBcafdsoh/Zr3UiQSI9 OabqLfDb4GryVz95RcpgoPXc= X-Received: by 127.0.0.2 with SMTP id VoveYY1788612x5QfBU4WAfS; Thu, 26 Oct 2023 16:54:02 -0700 X-Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by mx.groups.io with SMTP id smtpd.web10.215563.1698364441403687584 for ; Thu, 26 Oct 2023 16:54:01 -0700 X-Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-507b96095abso2173091e87.3 for ; Thu, 26 Oct 2023 16:54:01 -0700 (PDT) X-Gm-Message-State: NXZZtZMq63ghWRfUsngg6lGux1787277AA= X-Google-Smtp-Source: AGHT+IEOEgU9IiDlZld6gSsevaZOvI64Oan/QHV49HSNC6B2qbBJsmUB85/eTtRXzzSZE6YRvNOlbA== X-Received: by 2002:a05:6512:2396:b0:503:343a:829f with SMTP id c22-20020a056512239600b00503343a829fmr842602lfv.23.1698364439433; Thu, 26 Oct 2023 16:53:59 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u8-20020a056512040800b00507a8789b43sm39389lfk.269.2023.10.26.16.53.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 16:53:59 -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] [edk2-redfish-client][PATCH v2 03/11] RedfishLib: remove redudant zeroing Date: Fri, 27 Oct 2023 02:53:46 +0300 Message-Id: <20231026235354.67625-4-mike.maslenkin@gmail.com> In-Reply-To: <20231026235354.67625-1-mike.maslenkin@gmail.com> References: <20231026235354.67625-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: 1698364443651100014 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: Nickle Wang --- .../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 (#110148): https://edk2.groups.io/g/devel/message/110148 Mute This Topic: https://groups.io/mt/102211772/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 Wed May 15 15:22:20 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+110149+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+110149+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698364443; cv=none; d=zohomail.com; s=zohoarc; b=mgPuk9XQiUo3decJuy/bX3ouCiG4IP8KItK7+ruvT2u+GwjBolRblNFf/4nhFMX3L1OjZBcxDbinktaTMNBeG6X/ddvkZl48nFYfIE/FHZfdvBBXjKMIkxtIl4nwBHHvstbOPsJZADhntVqCruKiVtgNxmKfpmf8IL5yWZEt7hE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698364443; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=RAnGXpiAzqrcUuCrhVO2qSk1BY9m33Lb05HWQgWVPT4=; b=ZHMEAyC81GyyddSnW92KvtRkZoIjrIhk0SpDLj4OWNtTgeTevqI1LvAxsJhIkUn7ZwkFQ6TWdz/hOsGlk2Qi5LOMzJpbrR72i8RWa2UgugD2qzXCt1+MXpMitVCEsWUBR8Ca1pLqk7b7O/5McedzSe7bV/dt/NvdAEaJ5r0U7ro= 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+110149+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 1698364443515689.0091231170417; Thu, 26 Oct 2023 16:54:03 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=OpbBZ86m4TjfwfFa6orJp3tsUxZ6cUnEYTSEndVp4dg=; 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=1698364443; v=1; b=j4A3dsnmoii9WjRcclPZw9OYgfBtxClZln8WyXqSzBFTURRrevrIpnG9DnYQ0uJ6aWgKNUEO u39v5S2sv0N2EiSIljgcnunMEcWMIlISwlCrTWGShhD9uZaPznuTUupENmkHdy5W26wFdJixcw3 txFtuYKTpLuhKAFCWPTFlxlw= X-Received: by 127.0.0.2 with SMTP id yJZ4YY1788612x2xYsk10PZr; Thu, 26 Oct 2023 16:54:03 -0700 X-Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by mx.groups.io with SMTP id smtpd.web10.215565.1698364442410027940 for ; Thu, 26 Oct 2023 16:54:02 -0700 X-Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-507a62d4788so2355896e87.0 for ; Thu, 26 Oct 2023 16:54:02 -0700 (PDT) X-Gm-Message-State: RbmYkvrSWf36mn8gDtT4qlmJx1787277AA= X-Google-Smtp-Source: AGHT+IHg9RmaI4B+Ym+pefQZT/YgF3rnH3uO/ZAl2+HiY5yLU+CV5/eLydIvywEpfV50RnlVP4oBtA== X-Received: by 2002:ac2:5a02:0:b0:504:31a0:f9e2 with SMTP id q2-20020ac25a02000000b0050431a0f9e2mr574156lfn.58.1698364440277; Thu, 26 Oct 2023 16:54:00 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u8-20020a056512040800b00507a8789b43sm39389lfk.269.2023.10.26.16.53.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 16:53:59 -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] [edk2-redfish-client][PATCH v2 04/11] RedfishClientPkg: RedfishFeatureUtilityLib: fix memory leaks Date: Fri, 27 Oct 2023 02:53:47 +0300 Message-Id: <20231026235354.67625-5-mike.maslenkin@gmail.com> In-Reply-To: <20231026235354.67625-1-mike.maslenkin@gmail.com> References: <20231026235354.67625-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: 1698364445685100022 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mike Maslenkin Reviewed-by: Nickle Wang --- .../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 (#110149): https://edk2.groups.io/g/devel/message/110149 Mute This Topic: https://groups.io/mt/102211773/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 Wed May 15 15:22:20 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+110150+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+110150+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698364444; cv=none; d=zohomail.com; s=zohoarc; b=RY0Vjw4tG07jnYENjAn2sLYmvgW5g2QBkXvbFag6HYqa09L/sTysqvXgH03lfYtBpXSkUBo7V3HlsDhiJagAoNmFhaYYvJ782adaiiRsn75mSC2a+pmVtAPD6uZL/n3uKCIWsULOKo3DjCbagB9TrNmKufBp5xvZFuu0v80t38k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698364444; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=BUNHWiRJRuTHLwXOa8lr2Rb56Nz6I+a1qhPfxA0W7CU=; b=geJOK/h/VMkPsHSGAhmi//x/KovZWi9tzSVbxvZQhq18fgxk9Vjsp2w+QXN1PqRK6eDs1O+d81uVc38hj/ADQYQUIaErS5qoUJN1s06xTlXHflk0hI9SQ75KLbP3uzD/qRrAvfdEMGhhwu8rt9a5/riU3O3SV+COGuL5AVrn8+M= 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+110150+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 1698364444421465.054903648077; Thu, 26 Oct 2023 16:54:04 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=+n4NqtS+SGsnF5QfRfdW4W6KzkYWCjAn5+jSMZGCZ20=; 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=1698364444; v=1; b=rQCCbKWigJwiCQIHtUMgmoWNlMg7vgGc+x+HfutRlWoNfBgW6YpkY5soih+rypKw1kDtCFMN T6l79qBsp7FFVDOdn4MVDu7kcQAFhJ600y8cteQxX9Kf5OiRXH8IXDN9xDhr8FL/RDGrnzj+lz2 wvk/ZFDPaBhEz6AgfDNcodc8= X-Received: by 127.0.0.2 with SMTP id PsDQYY1788612xpu11SQdo4S; Thu, 26 Oct 2023 16:54:04 -0700 X-Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by mx.groups.io with SMTP id smtpd.web11.86066.1698364443182308202 for ; Thu, 26 Oct 2023 16:54:03 -0700 X-Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-5079f3f3d7aso2337110e87.1 for ; Thu, 26 Oct 2023 16:54:02 -0700 (PDT) X-Gm-Message-State: k1SBjhwSBb9qcxWinEB9Ni1Sx1787277AA= X-Google-Smtp-Source: AGHT+IHwE8WYPe5u46yPJ9XaT76x69Y9WVvSVr1Twd8S5asFjcQ/drcJLEPcOoRC+dIG8XRQ/lsZxQ== X-Received: by 2002:ac2:58ca:0:b0:507:9fa0:e244 with SMTP id u10-20020ac258ca000000b005079fa0e244mr562115lfo.65.1698364441082; Thu, 26 Oct 2023 16:54:01 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u8-20020a056512040800b00507a8789b43sm39389lfk.269.2023.10.26.16.54.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 16:54:00 -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] [edk2-redfish-client][PATCH v2 05/11] RedfishClientPkg: reduce identation level by adding early return Date: Fri, 27 Oct 2023 02:53:48 +0300 Message-Id: <20231026235354.67625-6-mike.maslenkin@gmail.com> In-Reply-To: <20231026235354.67625-1-mike.maslenkin@gmail.com> References: <20231026235354.67625-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: 1698364445699100023 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 (#110150): https://edk2.groups.io/g/devel/message/110150 Mute This Topic: https://groups.io/mt/102211774/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 Wed May 15 15:22:20 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+110151+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+110151+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698364444; cv=none; d=zohomail.com; s=zohoarc; b=PJLJk4/RmbbiyjEtodW8HKSJb9OB3jKP7tN3RZWQJ4AI6FNCPCqVR6eL33Y7Kg5q/+NrSaze+6DWkvMFJTpd7Ju71VcxDFuIN0PP6vqe3XPdCeQnKCdceSVZNa2g0bu5pEH5Yc150VeKKuzdcAQ+TFdEDPJgm8MH8Vk0QT7EXP0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698364444; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=SZVCiQoNabO4LjoYJrVygiqfe2ZhMuCJjdvijEt/JCU=; b=b39Pp+Aqyz2jk9WcEc4a9jXOFf4Cqzrm8Q6H0LeBFAiQxOd/lxHv3V0O2DWtELoab1I8qwmWKUw0JpgZDE0H8jp+OWq14HJD4jUVBM+kj87iXde6m6KVxcAzpxm2pIrfTsC/exLQUjerkv/WSPOlHBTOFw6kK50jENQTkgZbmDg= 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+110151+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 16983644449211008.144635240082; Thu, 26 Oct 2023 16:54:04 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=VxHADRnO94uK0zoIArXNIM2MvdF8EM6S94wrlSjpYDs=; 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=1698364444; v=1; b=jOgRLd8nxy1L0GQHo8C2gSaFjbwUSdxv6lLYVe+HDxfdP9aMVR8Bm3Lr9+RzHUBCY+mno+oZ o6d7hUFJByjiaYMhI4Qn6LSgA1Ew44ILeB5eM4UH3ySU8jKQISGeey7iaHS8c3o389syVGn0wvy sIU5d5H/Xq2WMkhejdUTX6Bs= X-Received: by 127.0.0.2 with SMTP id dqIMYY1788612xhyzGm3vL4E; Thu, 26 Oct 2023 16:54:04 -0700 X-Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mx.groups.io with SMTP id smtpd.web11.86067.1698364443795745588 for ; Thu, 26 Oct 2023 16:54:04 -0700 X-Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-507975d34e8so2217228e87.1 for ; Thu, 26 Oct 2023 16:54:03 -0700 (PDT) X-Gm-Message-State: 2MXy31Sk0fT5SQYGeIFCdcpjx1787277AA= X-Google-Smtp-Source: AGHT+IHotpsy7TY6TDWbT/r8OXwl8NqSYsX/FwzPxf9iTrhCLIPCCedsrU+PtQYwxwhkYgLtr3ZEOg== X-Received: by 2002:ac2:4282:0:b0:507:a12c:558c with SMTP id m2-20020ac24282000000b00507a12c558cmr571578lfh.46.1698364441915; Thu, 26 Oct 2023 16:54:01 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u8-20020a056512040800b00507a8789b43sm39389lfk.269.2023.10.26.16.54.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 16:54:01 -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] [edk2-redfish-client][PATCH v2 06/11] RedfishClientPkg: fix memory leaks while applying feature settings Date: Fri, 27 Oct 2023 02:53:49 +0300 Message-Id: <20231026235354.67625-7-mike.maslenkin@gmail.com> In-Reply-To: <20231026235354.67625-1-mike.maslenkin@gmail.com> References: <20231026235354.67625-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: 1698364445639100021 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mike Maslenkin Reviewed-by: Nickle Wang --- .../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 (#110151): https://edk2.groups.io/g/devel/message/110151 Mute This Topic: https://groups.io/mt/102211775/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 Wed May 15 15:22:20 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+110152+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+110152+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698364445; cv=none; d=zohomail.com; s=zohoarc; b=I4PXfvKryGjjvygmQF/nXfHGAZ4R6Sbsx3KgdvtCgWGFWBV3ow8WYCNcmBqM3R3US2KwSyNfjqeZBrdnb4nBRr8Ifb8cygzLVjcdXYI1UIJC8IBLFS+vsPWOqXrIBGEZniBeCtqADNIwRsKvQ1ImxidRPDcqAb83agLMZ5wlhHE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698364445; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=gXqFbdDlp9AY59N/9BUjRyKdQeJTppcGjl0XLqJTfK4=; b=CQwIyGyeagL2HS8HoyHqUIRKqwq9smfkSQdGBzUWWzQ/xfGk1/hZ9w9M4klF/ZhTQDD2v+qnTc0aVxNhY30gxrAI0TP0fQVT9gg2JmaExkmhtBbqk9uHmRVpa9amHedY7ZHs4Ry3kNcK71elwEznMsxho/fh26QKwC9M3cpNq8g= 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+110152+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 1698364445820905.3770456893042; Thu, 26 Oct 2023 16:54:05 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=LGVDlsqEJ34rZQXjUQiGWHPKATDlCv2YRFof3WV60mY=; 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=1698364445; v=1; b=NnCWbTHd9+XfUKnlb8G/6/7emToLvejg+WDkcrK/Fl0cZIu4LPj9ov9k23/P4fyxDgQ8IP31 UM/5ZPvveV6g38WW0FNHltUzIRAHjd0DUOC2Y3F0uZQv5g9bAh6fWkm6QK+YkhHk39l+dIlpASc ZfFskVbHKT0nHdXQZqRsLS0g= X-Received: by 127.0.0.2 with SMTP id 6VvlYY1788612xb4kPEi4cdp; Thu, 26 Oct 2023 16:54:05 -0700 X-Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mx.groups.io with SMTP id smtpd.web10.215567.1698364444710503378 for ; Thu, 26 Oct 2023 16:54:05 -0700 X-Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-5082a874098so12064e87.3 for ; Thu, 26 Oct 2023 16:54:04 -0700 (PDT) X-Gm-Message-State: i3Jvh0jRQ1tlJe5npY23onlTx1787277AA= X-Google-Smtp-Source: AGHT+IGVAoSDDFuitkrllyL5mtam3hiR9hyr/qnqfvSDj6zz2i87kIco8wTflWyrJ/zZK9YSP7OH8w== X-Received: by 2002:ac2:48b4:0:b0:507:9f0a:60e5 with SMTP id u20-20020ac248b4000000b005079f0a60e5mr574393lfg.43.1698364442785; Thu, 26 Oct 2023 16:54:02 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u8-20020a056512040800b00507a8789b43sm39389lfk.269.2023.10.26.16.54.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 16:54:02 -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] [edk2-redfish-client][PATCH v2 07/11] RedfishClientPkg: fix memory leak Date: Fri, 27 Oct 2023 02:53:50 +0300 Message-Id: <20231026235354.67625-8-mike.maslenkin@gmail.com> In-Reply-To: <20231026235354.67625-1-mike.maslenkin@gmail.com> References: <20231026235354.67625-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: 1698364447634100033 Content-Type: text/plain; charset="utf-8" This patch fixes leak in RedfishExternalResourceResourceFeatureCallback function. Signed-off-by: Mike Maslenkin Reviewed-by: Nickle Wang --- 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 (#110152): https://edk2.groups.io/g/devel/message/110152 Mute This Topic: https://groups.io/mt/102211776/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 Wed May 15 15:22:20 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+110153+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+110153+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698364446; cv=none; d=zohomail.com; s=zohoarc; b=FapEI5PfXAWcmD3dTGoBOOHYsT9+7g85S8XyOpPacoYnj+jsnnp5HbTCb2P1579n5N4M2qQuDeN9fKSbYRmcYV/HZbFo92SqRyyUPOSoUGKNxUZFSUT7dgpe5gQiPKZUCPPBAeYKMB9OppVAsWUh86b8QrbdxAOIALC+5UKM3uI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698364446; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=J3YpjxIVX37AYk2vp5+BX0sK0+j6CxR9vWuXFq3VhGs=; b=Z31Zh9Z9soyPwn8YpsWsHhvkSTX+JOiV1XQytAPhf7WdBylGPnTWYeucrEQmm3XgfNSCdEZgDaPGMcBstH/2/dwYxmgM7xJaJxYxZOh3DnJt1GkHmFarhaYiQFseTRf6iaSHc1Sp9xfK0ADDo8pKFvT6lKdURYrUMQBq2kozhXI= 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+110153+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 1698364446626146.26675143056968; Thu, 26 Oct 2023 16:54:06 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=0WZHioGHZ3crKEbtyC1j6gLX8uyWJMsHMumdwcEOY3M=; 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=1698364446; v=1; b=Y/f8CQ7o05U6BlNNlJlA7Xq6Up/hhZCsgtc6/yTPUwmcqaBp934Ea3fPUtR2wwuL8dpcJAw0 Y9HRwnD7q30KRuRUNPf9m1HKQb18iAa9c3YHozg57r2OnaFhmCgZZbOqkGT5dPX/s5T7VWQMNUN 1KgXzqcHqHNRsqf3pAYwxGxs= X-Received: by 127.0.0.2 with SMTP id jpAhYY1788612xfcXKH5U31H; Thu, 26 Oct 2023 16:54:06 -0700 X-Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by mx.groups.io with SMTP id smtpd.web11.86070.1698364445540934540 for ; Thu, 26 Oct 2023 16:54:05 -0700 X-Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-507d1cc0538so2079494e87.2 for ; Thu, 26 Oct 2023 16:54:05 -0700 (PDT) X-Gm-Message-State: F07z8mRZ6EEDp8OQ75OEOP0Fx1787277AA= X-Google-Smtp-Source: AGHT+IEyuSIbfTI5YC59TGYs4BbFaXr/jrTtfO/mt1Pm9ZTSPIyLpf9NmJaV623H8KRDY2pNjGr6+A== X-Received: by 2002:a05:6512:282c:b0:508:2022:7738 with SMTP id cf44-20020a056512282c00b0050820227738mr601860lfb.19.1698364443559; Thu, 26 Oct 2023 16:54:03 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u8-20020a056512040800b00507a8789b43sm39389lfk.269.2023.10.26.16.54.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 16:54:03 -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] [edk2-redfish-client][PATCH v2 08/11] RedfishClientPkg: fix pragma pack usage Date: Fri, 27 Oct 2023 02:53:51 +0300 Message-Id: <20231026235354.67625-9-mike.maslenkin@gmail.com> In-Reply-To: <20231026235354.67625-1-mike.maslenkin@gmail.com> References: <20231026235354.67625-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: 1698364447642100034 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mike Maslenkin 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 (#110153): https://edk2.groups.io/g/devel/message/110153 Mute This Topic: https://groups.io/mt/102211777/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 Wed May 15 15:22:20 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+110154+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+110154+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698364447; cv=none; d=zohomail.com; s=zohoarc; b=kZy0cQ7o8SHyjXpdjPDeN8GcGX3DosebXzrGq/Y+OT/E3G20QQBmgFtYU+kUsNqcydwdLCqnMEe+3N09/Rdn8N0m+v4rV8Y8EQ19EZsgWcxjlVA67e8237bXfyLyf6JWi2cIQSRkFBorqf+JnVP4+/koUIGOUDMk+AeVhEu2T0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698364447; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=PEcN5Smf3gcITUXasfxuS1wv4wviFsV2w3PI4E7lfIw=; b=SG1BBwz+ZLY7NMyveyL6hU+JmMn295jFGyeNSClei0bQ2moVYLnhX7gj4U/EpmN1/UEbP8NkQBB8x/fEf7IMrk4sUnuY7KgHBGWIKRxyNfsIBirvpItoMQTzVMmpy+azhkx6uuKUOIzi3LcyYYcmk3VhTayj7DQku1awQ0uBDg4= 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+110154+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 1698364447606966.003045927035; Thu, 26 Oct 2023 16:54:07 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Xcfu99pnoE+mb8XwivCZ7G8YSNGxv8Q6qXVosHC6KO8=; 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=1698364447; v=1; b=XTvVfTOCnOb+CUCOgnQX8+ZOsNujY+JWvr/nqYQ/W1ma9Zxsv0sk5JKHNEbbovNh3fcc9HSm ObVLavI3qKB0tQ03fI9kr0xD6u+Opr7mPMw7Kg5LKfz3jC3yycbc4p9gkS8LQaA9OBpo8SiN3N/ ziJ4VJxQdoIp6tUP7MyNtixo= X-Received: by 127.0.0.2 with SMTP id SzyOYY1788612xDerDcplkAX; Thu, 26 Oct 2023 16:54:07 -0700 X-Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mx.groups.io with SMTP id smtpd.web11.86072.1698364446408328049 for ; Thu, 26 Oct 2023 16:54:06 -0700 X-Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-507c78d258fso2247713e87.2 for ; Thu, 26 Oct 2023 16:54:06 -0700 (PDT) X-Gm-Message-State: eWTQiAO2z7b6sx1gZ4FDANyTx1787277AA= X-Google-Smtp-Source: AGHT+IGFvy7IEzFcAqll19iS16n0bGfP6j8BqFxoIg4cw1M3bjqeM4SK0fYf3ILQtQbJVlzSa5MB5A== X-Received: by 2002:ac2:5234:0:b0:4fd:c844:6a43 with SMTP id i20-20020ac25234000000b004fdc8446a43mr631511lfl.43.1698364444446; Thu, 26 Oct 2023 16:54:04 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u8-20020a056512040800b00507a8789b43sm39389lfk.269.2023.10.26.16.54.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 16:54:03 -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] [edk2-redfish-client][PATCH v2 09/11] RedfishClientPkg: fix StrnCpyS arguments Date: Fri, 27 Oct 2023 02:53:52 +0300 Message-Id: <20231026235354.67625-10-mike.maslenkin@gmail.com> In-Reply-To: <20231026235354.67625-1-mike.maslenkin@gmail.com> References: <20231026235354.67625-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: 1698364449657100042 Content-Type: text/plain; charset="utf-8" StrnCpyS accepts string length in characters, not in bytes. Signed-off-by: Mike Maslenkin Reviewed-by: Abner Chang Reviewed-by: Nickle Wang --- 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 (#110154): https://edk2.groups.io/g/devel/message/110154 Mute This Topic: https://groups.io/mt/102211778/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 Wed May 15 15:22:20 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+110155+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+110155+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698364448; cv=none; d=zohomail.com; s=zohoarc; b=PrRWCvoXFH6j2q3vpIf5kVt4YvtkbOkcEGSXEfskkGicd+GsK2AmFIk9J6L69Xsqrwq/vaC/FFHTDg+YYEkLKFWoAUPlalypdmag2YLs9s+Ev9dVmTC5ZLh45Ca8+BFKqny0GjMORugI6JAYqM4etqYRPIMG23MkUt4E4n1O1x4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698364448; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=kr+zrgHCwsLDJD1AwND01qD9/dCsKKSgZN1Zf9pbIcw=; b=hLpRKVKdP/2IN1lLto7cw1TnIrvlUHVzkmw14Sj4XiUtpvP2uRLsacAiZ8VwFpwBO+azKSU1qB5719OBRS78duXxylC/8NUAEBqbjVrDOjJ3om5egH85OTGle2H1D2Oxsh50JA3f0JwL0JVKbcUC5XOTSB0S4RfGno1rEW+hkso= 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+110155+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 1698364448200682.4532854766508; Thu, 26 Oct 2023 16:54:08 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=mi/AQU2sMTRq0Yb88ofbxNWY7l+jayNxPDDq2ggDBQE=; 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=1698364447; v=1; b=FrUa89DnZrig7xG4NZuLD0SS/5OzlY9YQnGlEKvi2AGTIGdxti9mOVQKKHfs0lH0p0UuTJII BJJ9SZMRghSwMfbUANVN63ePNM2g0lkLA6FRKXXJM9H7mF8+OQ9jXe7XVkChhzlMNyLGuWRrYN7 sWNiW+qqdmvaZ7IAyfU4wSH8= X-Received: by 127.0.0.2 with SMTP id x1pfYY1788612xGXd4PtxNJG; Thu, 26 Oct 2023 16:54:07 -0700 X-Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by mx.groups.io with SMTP id smtpd.web10.215568.1698364447009582411 for ; Thu, 26 Oct 2023 16:54:07 -0700 X-Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-507962561adso2272021e87.0 for ; Thu, 26 Oct 2023 16:54:06 -0700 (PDT) X-Gm-Message-State: baXMXx5sDy71gz7Z9PSLJEHVx1787277AA= X-Google-Smtp-Source: AGHT+IEZ9PAQxxvl3hGiBzDvpSClD9fwwFCL7dF1HNveZJjvmIKvv/92bgauxd8BsCwAHnAd315mDw== X-Received: by 2002:a05:6512:3b10:b0:507:9b70:1f0e with SMTP id f16-20020a0565123b1000b005079b701f0emr797394lfv.24.1698364445150; Thu, 26 Oct 2023 16:54:05 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u8-20020a056512040800b00507a8789b43sm39389lfk.269.2023.10.26.16.54.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 16:54:04 -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] [edk2-redfish-client][PATCH v2 10/11] RedfishFeatureCoreDxe: replace __FUNCTION__ with __func__ Date: Fri, 27 Oct 2023 02:53:53 +0300 Message-Id: <20231026235354.67625-11-mike.maslenkin@gmail.com> In-Reply-To: <20231026235354.67625-1-mike.maslenkin@gmail.com> References: <20231026235354.67625-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: 1698364449657100041 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mike Maslenkin Reviewed-by: Nickle Wang --- .../RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c= b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c index c19d4a46d6af..f71b12e4b5e0 100644 --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c @@ -319,14 +319,14 @@ NewInternalInstance ( REDFISH_FEATURE_INTERNAL_DATA *NewInternalData; =20 if ((PtrToNewInternalData =3D=3D NULL) || (NodeName =3D=3D NULL)) { - DEBUG ((DEBUG_ERROR, "%a: Inproper given parameters\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a: Inproper given parameters\n", __func__)); return EFI_INVALID_PARAMETER; } =20 *PtrToNewInternalData =3D NULL; NewInternalData =3D AllocateZeroPool (sizeof (REDFISH_FEATURE_INTE= RNAL_DATA)); if (NewInternalData =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, "%a: No memory for REDFISH_FEATURE_INTERNAL_DATA\= n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a: No memory for REDFISH_FEATURE_INTERNAL_DATA\= n", __func__)); return EFI_OUT_OF_RESOURCES; } =20 @@ -377,12 +377,12 @@ InsertRedfishFeatureUriNode ( =20 *MatchNodeEntry =3D NULL; if (NodeName =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, "%a: Node name is NULL.\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a: Node name is NULL.\n", __func__)); return EFI_INVALID_PARAMETER; } =20 if (NextNodeEntry =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, "%a: NextNodeEntry can't be NULL.\n", __FUNCTION_= _)); + DEBUG ((DEBUG_ERROR, "%a: NextNodeEntry can't be NULL.\n", __func__)); return EFI_INVALID_PARAMETER; } =20 @@ -487,7 +487,7 @@ RedfishFeatureRegister ( BOOLEAN ItsCollection; =20 if ((FeatureManagedUri =3D=3D NULL) || (Callback =3D=3D NULL)) { - DEBUG ((DEBUG_ERROR, "%a: The given parameter is invalid\n", __FUNCTIO= N__)); + DEBUG ((DEBUG_ERROR, "%a: The given parameter is invalid\n", __func__)= ); return EFI_INVALID_PARAMETER; } =20 @@ -503,7 +503,7 @@ RedfishFeatureRegister ( while ((Index < UriLength)) { if ((Index - AnchorIndex + 1) >=3D MaxNodeNameLength) { // Increase one for the NULL terminator - DEBUG ((DEBUG_ERROR, "%a: the length of node name is >=3D MaxNodeNam= eLength\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a: the length of node name is >=3D MaxNodeNam= eLength\n", __func__)); ASSERT (FALSE); } =20 @@ -568,7 +568,7 @@ RedfishFeatureRegister ( // // No URI node was created // - DEBUG ((DEBUG_ERROR, "%a: No URI node is added\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a: No URI node is added\n", __func__)); return EFI_INVALID_PARAMETER; } =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 (#110155): https://edk2.groups.io/g/devel/message/110155 Mute This Topic: https://groups.io/mt/102211779/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 Wed May 15 15:22:20 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+110156+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+110156+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698364449; cv=none; d=zohomail.com; s=zohoarc; b=JCjH/BxJ3HimMfchppD3kVVhshYGa638rz2BBBLN2Is4nc8qyf3GssePy7vNChkGbj0FQeLejj5yhT7PizZOl+W+YVuQsvFjVer6Yr4sJsIkFlq33QnzefIl7ps07TfuxYzCLMDjgncQj1gSLkexbkelyJuowhpL5PFfnKvrlpA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698364449; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=C1S7WK0Q7ipQxp3WecQXvV9nQtGj7qt9AZxjubJXr0c=; b=Kntc7Wv1L32XLMgP5YJ1b6cDlsnPdkI796n60UPisUVl8HszaWvNi62pGfO46BWkZlcuF6HMVuHiKWG2vSpnvkNAf7SLdE81gQhP0MEPltM0aYgzOaSPWcSHli1cUq/OyWJi1WE1iTHqJH/vhkaznFxlTIoPzS1UVyGdNiVgsRk= 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+110156+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 1698364449139222.11533019763328; Thu, 26 Oct 2023 16:54:09 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=3CoiJspeWLmtEwHwV5/O9/2ghqur6JGHFmNEdqP+eYc=; 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=1698364448; v=1; b=HfnxyBBHVjkqSTffbMcmCf+ALqxt7urG95Nhr4pxkzgDrLAA9XZxuj94c0fPFfX8P+zOibD2 +6mNYu5XzoRAtFzIYoXvIEM4NjxzDmM9AqX1TemEBSwkWV0kreJ6XAeNvav5rp6KZLrTJCLui9j JPL4qRR5AGqKaCQik3pxAEpI= X-Received: by 127.0.0.2 with SMTP id rX6OYY1788612xA1ewNwrptp; Thu, 26 Oct 2023 16:54:08 -0700 X-Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by mx.groups.io with SMTP id smtpd.web10.215570.1698364448092491833 for ; Thu, 26 Oct 2023 16:54:08 -0700 X-Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-50802148be9so1822590e87.2 for ; Thu, 26 Oct 2023 16:54:07 -0700 (PDT) X-Gm-Message-State: zn3hdoWmpHRVMvbLHOPvgKfSx1787277AA= X-Google-Smtp-Source: AGHT+IF1YWYj3u0UACJNWi+UNWznrYPrO1mDCH6PShRQTj5SbXvPmWsspMNPPiYDjn7MXaIOWMEtzg== X-Received: by 2002:a05:6512:491:b0:507:b0a1:6088 with SMTP id v17-20020a056512049100b00507b0a16088mr513256lfq.46.1698364446148; Thu, 26 Oct 2023 16:54:06 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u8-20020a056512040800b00507a8789b43sm39389lfk.269.2023.10.26.16.54.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 16:54:05 -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] [edk2-redfish-client][PATCH v2 11/11] RedfishFeatureCoreDxe: add check for memory allocation failure Date: Fri, 27 Oct 2023 02:53:54 +0300 Message-Id: <20231026235354.67625-12-mike.maslenkin@gmail.com> In-Reply-To: <20231026235354.67625-1-mike.maslenkin@gmail.com> References: <20231026235354.67625-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: 1698364449661100043 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mike Maslenkin Reviewed-by: Abner Chang Reviewed-by: Nickle Wang --- .../RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c= b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c index f71b12e4b5e0..d9aa6e1a8145 100644 --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c @@ -331,6 +331,12 @@ NewInternalInstance ( } =20 NewInternalData->NodeName =3D AllocateZeroPool (StrSize (NodeName)); + if (NewInternalData->NodeName =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: No memory for NodeName\n", __func__)); + FreePool (NewInternalData); + return EFI_OUT_OF_RESOURCES; + } + StrnCpyS (NewInternalData->NodeName, StrLen (NodeName) + 1, (CONST CHAR1= 6 *)NodeName, StrLen (NodeName)); NewInternalData->SiblingList =3D NULL; NewInternalData->ChildList =3D 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 (#110156): https://edk2.groups.io/g/devel/message/110156 Mute This Topic: https://groups.io/mt/102211780/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-