All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] vfio/pci: Fix error return code in vfio_ecap_init()
@ 2021-05-15  2:04 Zhen Lei
  2021-05-20 16:13 ` Max Gurtovoy
  2021-05-24 19:35 ` Alex Williamson
  0 siblings, 2 replies; 3+ messages in thread
From: Zhen Lei @ 2021-05-15  2:04 UTC (permalink / raw)
  To: Alex Williamson, Cornelia Huck, kvm; +Cc: Zhen Lei

The error code returned from vfio_ext_cap_len() is stored in 'len', not
in 'ret'.

Fixes: 89e1f7d4c66d ("vfio: Add PCI device driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/vfio/pci/vfio_pci_config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
index d57f037f65b85d4..70e28efbc51f80e 100644
--- a/drivers/vfio/pci/vfio_pci_config.c
+++ b/drivers/vfio/pci/vfio_pci_config.c
@@ -1581,7 +1581,7 @@ static int vfio_ecap_init(struct vfio_pci_device *vdev)
 			if (len == 0xFF) {
 				len = vfio_ext_cap_len(vdev, ecap, epos);
 				if (len < 0)
-					return ret;
+					return len;
 			}
 		}
 
-- 
2.26.0.106.g9fadedd



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

* Re: [PATCH 1/1] vfio/pci: Fix error return code in vfio_ecap_init()
  2021-05-15  2:04 [PATCH 1/1] vfio/pci: Fix error return code in vfio_ecap_init() Zhen Lei
@ 2021-05-20 16:13 ` Max Gurtovoy
  2021-05-24 19:35 ` Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Max Gurtovoy @ 2021-05-20 16:13 UTC (permalink / raw)
  To: Zhen Lei, Alex Williamson, Cornelia Huck, kvm


On 5/15/2021 5:04 AM, Zhen Lei wrote:
> The error code returned from vfio_ext_cap_len() is stored in 'len', not
> in 'ret'.
>
> Fixes: 89e1f7d4c66d ("vfio: Add PCI device driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>   drivers/vfio/pci/vfio_pci_config.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
> index d57f037f65b85d4..70e28efbc51f80e 100644
> --- a/drivers/vfio/pci/vfio_pci_config.c
> +++ b/drivers/vfio/pci/vfio_pci_config.c
> @@ -1581,7 +1581,7 @@ static int vfio_ecap_init(struct vfio_pci_device *vdev)
>   			if (len == 0xFF) {
>   				len = vfio_ext_cap_len(vdev, ecap, epos);
>   				if (len < 0)
> -					return ret;
> +					return len;
>   			}
>   		}

Looks good,

Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>


>   

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

* Re: [PATCH 1/1] vfio/pci: Fix error return code in vfio_ecap_init()
  2021-05-15  2:04 [PATCH 1/1] vfio/pci: Fix error return code in vfio_ecap_init() Zhen Lei
  2021-05-20 16:13 ` Max Gurtovoy
@ 2021-05-24 19:35 ` Alex Williamson
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2021-05-24 19:35 UTC (permalink / raw)
  To: Zhen Lei; +Cc: Cornelia Huck, kvm

On Sat, 15 May 2021 10:04:58 +0800
Zhen Lei <thunder.leizhen@huawei.com> wrote:

> The error code returned from vfio_ext_cap_len() is stored in 'len', not
> in 'ret'.
> 
> Fixes: 89e1f7d4c66d ("vfio: Add PCI device driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  drivers/vfio/pci/vfio_pci_config.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
> index d57f037f65b85d4..70e28efbc51f80e 100644
> --- a/drivers/vfio/pci/vfio_pci_config.c
> +++ b/drivers/vfio/pci/vfio_pci_config.c
> @@ -1581,7 +1581,7 @@ static int vfio_ecap_init(struct vfio_pci_device *vdev)
>  			if (len == 0xFF) {
>  				len = vfio_ext_cap_len(vdev, ecap, epos);
>  				if (len < 0)
> -					return ret;
> +					return len;
>  			}
>  		}
>  

Added to vfio for-linus branch for v5.13 w/ Max's R-b.  Thanks!

Alex


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

end of thread, other threads:[~2021-05-24 19:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-15  2:04 [PATCH 1/1] vfio/pci: Fix error return code in vfio_ecap_init() Zhen Lei
2021-05-20 16:13 ` Max Gurtovoy
2021-05-24 19:35 ` Alex Williamson

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.