linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] firmware: xilinx: check return value of zynqmp_pm_get_api_version()
@ 2021-10-06  8:43 Rajan Vaja
  2021-10-06  8:53 ` Michal Simek
  2021-10-18 13:14 ` Michal Simek
  0 siblings, 2 replies; 3+ messages in thread
From: Rajan Vaja @ 2021-10-06  8:43 UTC (permalink / raw)
  To: michal.simek, gregkh, arnd, manish.narani, nava.manne,
	lakshmi.sai.krishna.potthuri
  Cc: linux-arm-kernel, linux-kernel, Rajan Vaja

Currently return value of zynqmp_pm_get_api_version() is ignored.
Because of that, API version is checked in case of error also.
So add check for return value of zynqmp_pm_get_api_version().

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
---
 drivers/firmware/xilinx/zynqmp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
index a3cadba..070197e 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -1371,7 +1371,10 @@ static int zynqmp_firmware_probe(struct platform_device *pdev)
 		return ret;
 
 	/* Check PM API version number */
-	zynqmp_pm_get_api_version(&pm_api_version);
+	ret = zynqmp_pm_get_api_version(&pm_api_version);
+	if (ret)
+		return ret;
+
 	if (pm_api_version < ZYNQMP_PM_VERSION) {
 		panic("%s Platform Management API version error. Expected: v%d.%d - Found: v%d.%d\n",
 		      __func__,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] firmware: xilinx: check return value of zynqmp_pm_get_api_version()
  2021-10-06  8:43 [PATCH] firmware: xilinx: check return value of zynqmp_pm_get_api_version() Rajan Vaja
@ 2021-10-06  8:53 ` Michal Simek
  2021-10-18 13:14 ` Michal Simek
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Simek @ 2021-10-06  8:53 UTC (permalink / raw)
  To: Rajan Vaja, michal.simek, gregkh, arnd, manish.narani,
	nava.manne, lakshmi.sai.krishna.potthuri
  Cc: linux-arm-kernel, linux-kernel



On 10/6/21 10:43 AM, Rajan Vaja wrote:
> Currently return value of zynqmp_pm_get_api_version() is ignored.
> Because of that, API version is checked in case of error also.
> So add check for return value of zynqmp_pm_get_api_version().
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
>  drivers/firmware/xilinx/zynqmp.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
> index a3cadba..070197e 100644
> --- a/drivers/firmware/xilinx/zynqmp.c
> +++ b/drivers/firmware/xilinx/zynqmp.c
> @@ -1371,7 +1371,10 @@ static int zynqmp_firmware_probe(struct platform_device *pdev)
>  		return ret;
>  
>  	/* Check PM API version number */
> -	zynqmp_pm_get_api_version(&pm_api_version);
> +	ret = zynqmp_pm_get_api_version(&pm_api_version);
> +	if (ret)
> +		return ret;
> +
>  	if (pm_api_version < ZYNQMP_PM_VERSION) {
>  		panic("%s Platform Management API version error. Expected: v%d.%d - Found: v%d.%d\n",
>  		      __func__,
> 

Reviewed-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] firmware: xilinx: check return value of zynqmp_pm_get_api_version()
  2021-10-06  8:43 [PATCH] firmware: xilinx: check return value of zynqmp_pm_get_api_version() Rajan Vaja
  2021-10-06  8:53 ` Michal Simek
@ 2021-10-18 13:14 ` Michal Simek
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Simek @ 2021-10-18 13:14 UTC (permalink / raw)
  To: Rajan Vaja, michal.simek, gregkh, arnd, manish.narani,
	nava.manne, lakshmi.sai.krishna.potthuri
  Cc: linux-arm-kernel, linux-kernel



On 10/6/21 10:43, Rajan Vaja wrote:
> Currently return value of zynqmp_pm_get_api_version() is ignored.
> Because of that, API version is checked in case of error also.
> So add check for return value of zynqmp_pm_get_api_version().
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
>   drivers/firmware/xilinx/zynqmp.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
> index a3cadba..070197e 100644
> --- a/drivers/firmware/xilinx/zynqmp.c
> +++ b/drivers/firmware/xilinx/zynqmp.c
> @@ -1371,7 +1371,10 @@ static int zynqmp_firmware_probe(struct platform_device *pdev)
>   		return ret;
>   
>   	/* Check PM API version number */
> -	zynqmp_pm_get_api_version(&pm_api_version);
> +	ret = zynqmp_pm_get_api_version(&pm_api_version);
> +	if (ret)
> +		return ret;
> +
>   	if (pm_api_version < ZYNQMP_PM_VERSION) {
>   		panic("%s Platform Management API version error. Expected: v%d.%d - Found: v%d.%d\n",
>   		      __func__,
> 

Applied.
M

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-18 13:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-06  8:43 [PATCH] firmware: xilinx: check return value of zynqmp_pm_get_api_version() Rajan Vaja
2021-10-06  8:53 ` Michal Simek
2021-10-18 13:14 ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).