mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: Jay Buddhabhatti <jay.buddhabhatti@amd.com>, gregkh@linuxfoundation.org
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v3] drivers: soc: xilinx: check return status of get_api_version()
Date: Mon, 3 Jun 2024 13:06:48 +0200	[thread overview]
Message-ID: <31b120c7-c9d6-4b1e-92c6-e024727a7597@amd.com> (raw)
In-Reply-To: <20240515112345.24673-1-jay.buddhabhatti@amd.com>



On 5/15/24 13:23, Jay Buddhabhatti wrote:
> Currently return status is not getting checked for get_api_version
> and because of that for x86 arch we are getting below smatch error.
> 
>      CC      drivers/soc/xilinx/zynqmp_power.o
> drivers/soc/xilinx/zynqmp_power.c: In function 'zynqmp_pm_probe':
> drivers/soc/xilinx/zynqmp_power.c:295:12: warning: 'pm_api_version' is
> used uninitialized [-Wuninitialized]
>      295 |         if (pm_api_version < ZYNQMP_PM_VERSION)
>          |            ^
>      CHECK   drivers/soc/xilinx/zynqmp_power.c
> drivers/soc/xilinx/zynqmp_power.c:295 zynqmp_pm_probe() error:
> uninitialized symbol 'pm_api_version'.
> 
> So, check return status of pm_get_api_version and return error in case
> of failure to avoid checking uninitialized pm_api_version variable.
> 
> Fixes: b9b3a8be28b3 ("firmware: xilinx: Remove eemi ops for get_api_version")
> Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
> Cc: stable@vger.kernel.org
> ---
> V1: https://lore.kernel.org/lkml/20240424063118.23200-1-jay.buddhabhatti@amd.com/
> V2: https://lore.kernel.org/lkml/20240509045616.22338-1-jay.buddhabhatti@amd.com/
> V2->V3: Added stable tree email in cc
> V1->V2: Removed AMD copyright
> ---
>   drivers/soc/xilinx/zynqmp_power.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c
> index 965b1143936a..b82c01373f53 100644
> --- a/drivers/soc/xilinx/zynqmp_power.c
> +++ b/drivers/soc/xilinx/zynqmp_power.c
> @@ -190,7 +190,9 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
>   	u32 pm_api_version;
>   	struct mbox_client *client;
>   
> -	zynqmp_pm_get_api_version(&pm_api_version);
> +	ret = zynqmp_pm_get_api_version(&pm_api_version);
> +	if (ret)
> +		return ret;
>   
>   	/* Check PM API version number */
>   	if (pm_api_version < ZYNQMP_PM_VERSION)

Applied.
M

      reply	other threads:[~2024-06-03 11:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 11:23 Jay Buddhabhatti
2024-06-03 11:06 ` Michal Simek [this message]

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=31b120c7-c9d6-4b1e-92c6-e024727a7597@amd.com \
    --to=michal.simek@amd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jay.buddhabhatti@amd.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@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

all inboxes | Powered by JetHome®