Re: [PATCH] fwctl/pds: propagate actual error code instead of hardcoded -ENOMEM

From: Dave Jiang

Date: Wed Jun 03 2026 - 12:54:38 EST




On 6/2/26 6:22 PM, Jackie Liu wrote:
> From: Jackie Liu <liuyun01@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>

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

> ---
> 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;
> }