X86 platform drivers
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	 Hans de Goede <hdegoede@redhat.com>,
	 Mario Limonciello <mario.limonciello@amd.com>,
	 platform-driver-x86@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	 kernel-janitors@vger.kernel.org, dan.carpenter@linaro.org
Subject: Re: [PATCH] platform/x86/amd/pmf: Fix missing error code in amd_pmf_init_smart_pc()
Date: Mon, 26 Feb 2024 16:53:50 +0200 (EET)	[thread overview]
Message-ID: <a7b4dfc8-8be9-911a-6c56-4f84c1b85d73@linux.intel.com> (raw)
In-Reply-To: <20240226144011.2100804-1-harshit.m.mogalapalli@oracle.com>

[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]

On Mon, 26 Feb 2024, Harshit Mogalapalli wrote:

> On the error path, assign -ENOMEM to ret when memory allocation of
> "dev->prev_data" fails.
> 
> Fixes: e70961505808 ("platform/x86/amd/pmf: Fixup error handling for amd_pmf_init_smart_pc()")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
> This is based on static analysis with smatch, only compile tested
> ---
>  drivers/platform/x86/amd/pmf/tee-if.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/amd/pmf/tee-if.c b/drivers/platform/x86/amd/pmf/tee-if.c
> index 8527dca9cf56..dcbe8f85e122 100644
> --- a/drivers/platform/x86/amd/pmf/tee-if.c
> +++ b/drivers/platform/x86/amd/pmf/tee-if.c
> @@ -458,8 +458,10 @@ int amd_pmf_init_smart_pc(struct amd_pmf_dev *dev)
>  	amd_pmf_hex_dump_pb(dev);
>  
>  	dev->prev_data = kzalloc(sizeof(*dev->prev_data), GFP_KERNEL);
> -	if (!dev->prev_data)
> +	if (!dev->prev_data) {
> +		ret = -ENOMEM;
>  		goto error;
> +	}
>  
>  	ret = amd_pmf_start_policy_engine(dev);
>  	if (ret)
> 

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

-- 
 i.

  reply	other threads:[~2024-02-26 14:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26 14:40 [PATCH] platform/x86/amd/pmf: Fix missing error code in amd_pmf_init_smart_pc() Harshit Mogalapalli
2024-02-26 14:53 ` Ilpo Järvinen [this message]
2024-02-26 15:35   ` Mario Limonciello
2024-03-04 16:57 ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a7b4dfc8-8be9-911a-6c56-4f84c1b85d73@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=dan.carpenter@linaro.org \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=hdegoede@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox