All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fwctl/pds: propagate actual error code instead of hardcoded -ENOMEM
@ 2026-06-03  1:22 Jackie Liu
  2026-06-03 16:14 ` Creeley, Brett
  2026-06-03 16:53 ` Dave Jiang
  0 siblings, 2 replies; 3+ messages in thread
From: Jackie Liu @ 2026-06-03  1:22 UTC (permalink / raw)
  To: brett.creeley, dave.jiang; +Cc: linux-kernel

From: Jackie Liu <liuyun01@kylinos.cn>

When pdsfc_get_operations() fails in pdsfc_validate_rpc(), the
function hardcodes the return value to -ENOMEM regardless of the
actual failure. pdsfc_get_operations() can return various errors
from the adminq command (e.g. -ETIMEDOUT, -EIO, -ENODEV) or from
DMA mapping failure (-ENOMEM). Propagate the actual error via
PTR_ERR(operations) so userspace and debugging tools see the correct
failure reason.

Fixes: 92c66ee829b9 ("pds_fwctl: add rpc and query support")
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
---
 drivers/fwctl/pds/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fwctl/pds/main.c b/drivers/fwctl/pds/main.c
index 68fe254dd10a..a4e80cfa3c50 100644
--- a/drivers/fwctl/pds/main.c
+++ b/drivers/fwctl/pds/main.c
@@ -325,7 +325,7 @@ static int pdsfc_validate_rpc(struct pdsfc_dev *pdsfc,
 						  rpc->in.ep);
 		if (IS_ERR(operations)) {
 			mutex_unlock(&ep_info->lock);
-			return -ENOMEM;
+			return PTR_ERR(operations);
 		}
 		ep_info->operations = operations;
 	}
-- 
2.54.0


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

* Re: [PATCH] fwctl/pds: propagate actual error code instead of hardcoded -ENOMEM
  2026-06-03  1:22 [PATCH] fwctl/pds: propagate actual error code instead of hardcoded -ENOMEM Jackie Liu
@ 2026-06-03 16:14 ` Creeley, Brett
  2026-06-03 16:53 ` Dave Jiang
  1 sibling, 0 replies; 3+ messages in thread
From: Creeley, Brett @ 2026-06-03 16:14 UTC (permalink / raw)
  To: Jackie Liu, brett.creeley, dave.jiang; +Cc: linux-kernel



On 6/2/2026 6:22 PM, Jackie Liu wrote:
> [You don't often get email from liu.yun@linux.dev. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> From: Jackie Liu <liuyun01@kylinos.cn>
>
> When pdsfc_get_operations() fails in pdsfc_validate_rpc(), the
> function hardcodes the return value to -ENOMEM regardless of the
> actual failure. pdsfc_get_operations() can return various errors
> from the adminq command (e.g. -ETIMEDOUT, -EIO, -ENODEV) or from
> DMA mapping failure (-ENOMEM). Propagate the actual error via
> PTR_ERR(operations) so userspace and debugging tools see the correct
> failure reason.
>
> Fixes: 92c66ee829b9 ("pds_fwctl: add rpc and query support")
> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
> ---
>   drivers/fwctl/pds/main.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/fwctl/pds/main.c b/drivers/fwctl/pds/main.c
> index 68fe254dd10a..a4e80cfa3c50 100644
> --- a/drivers/fwctl/pds/main.c
> +++ b/drivers/fwctl/pds/main.c
> @@ -325,7 +325,7 @@ static int pdsfc_validate_rpc(struct pdsfc_dev *pdsfc,
>                                                    rpc->in.ep);
>                  if (IS_ERR(operations)) {
>                          mutex_unlock(&ep_info->lock);
> -                       return -ENOMEM;
> +                       return PTR_ERR(operations);

LGTM. Thanks for the fix.

Reviewed-by: Brett Creeley <brett.creeley@amd.com>

>                  }
>                  ep_info->operations = operations;
>          }
> --
> 2.54.0
>


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

* Re: [PATCH] fwctl/pds: propagate actual error code instead of hardcoded -ENOMEM
  2026-06-03  1:22 [PATCH] fwctl/pds: propagate actual error code instead of hardcoded -ENOMEM Jackie Liu
  2026-06-03 16:14 ` Creeley, Brett
@ 2026-06-03 16:53 ` Dave Jiang
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Jiang @ 2026-06-03 16:53 UTC (permalink / raw)
  To: Jackie Liu, brett.creeley; +Cc: linux-kernel



On 6/2/26 6:22 PM, Jackie Liu wrote:
> From: Jackie Liu <liuyun01@kylinos.cn>
> 
> When pdsfc_get_operations() fails in pdsfc_validate_rpc(), the
> function hardcodes the return value to -ENOMEM regardless of the
> actual failure. pdsfc_get_operations() can return various errors
> from the adminq command (e.g. -ETIMEDOUT, -EIO, -ENODEV) or from
> DMA mapping failure (-ENOMEM). Propagate the actual error via
> PTR_ERR(operations) so userspace and debugging tools see the correct
> failure reason.
> 
> Fixes: 92c66ee829b9 ("pds_fwctl: add rpc and query support")
> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>

> ---
>  drivers/fwctl/pds/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/fwctl/pds/main.c b/drivers/fwctl/pds/main.c
> index 68fe254dd10a..a4e80cfa3c50 100644
> --- a/drivers/fwctl/pds/main.c
> +++ b/drivers/fwctl/pds/main.c
> @@ -325,7 +325,7 @@ static int pdsfc_validate_rpc(struct pdsfc_dev *pdsfc,
>  						  rpc->in.ep);
>  		if (IS_ERR(operations)) {
>  			mutex_unlock(&ep_info->lock);
> -			return -ENOMEM;
> +			return PTR_ERR(operations);
>  		}
>  		ep_info->operations = operations;
>  	}


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

end of thread, other threads:[~2026-06-03 16:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-03  1:22 [PATCH] fwctl/pds: propagate actual error code instead of hardcoded -ENOMEM Jackie Liu
2026-06-03 16:14 ` Creeley, Brett
2026-06-03 16:53 ` Dave Jiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.