2014-07-20 05:47:34

by weiyj_lk

[permalink] [raw]
Subject: [PATCH] xen/pciback: Fix error return code in xen_pcibk_attach()

From: Wei Yongjun <[email protected]>

Fix to return -EFAULT from the error handling case instead of 0 when
version mismatch with pcifront.

Signed-off-by: Wei Yongjun <[email protected]>
---
drivers/xen/xen-pciback/xenbus.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/xen/xen-pciback/xenbus.c b/drivers/xen/xen-pciback/xenbus.c
index 4a7e6e0..c214daa 100644
--- a/drivers/xen/xen-pciback/xenbus.c
+++ b/drivers/xen/xen-pciback/xenbus.c
@@ -174,6 +174,7 @@ static int xen_pcibk_attach(struct xen_pcibk_device *pdev)
"version mismatch (%s/%s) with pcifront - "
"halting " DRV_NAME,
magic, XEN_PCI_MAGIC);
+ err = -EFAULT;
goto out;
}


2014-07-23 13:01:24

by Jan Beulich

[permalink] [raw]
Subject: Re: [Xen-devel] [PATCH] xen/pciback: Fix error return code in xen_pcibk_attach()

>>> On 20.07.14 at 07:46, <[email protected]> wrote:
> --- a/drivers/xen/xen-pciback/xenbus.c
> +++ b/drivers/xen/xen-pciback/xenbus.c
> @@ -174,6 +174,7 @@ static int xen_pcibk_attach(struct xen_pcibk_device *pdev)
> "version mismatch (%s/%s) with pcifront - "
> "halting " DRV_NAME,
> magic, XEN_PCI_MAGIC);
> + err = -EFAULT;
> goto out;
> }
>

While -EFAULT is kind of odd here, I realize this is because the same
also gets passed to xenbus_dev_fatal(); -EILSEQ, -ENODATA, or
-EPROTO (despite it normally being network specific) would seem
better to me.

In any event
Reviewed-by Jan Beulich <[email protected]>

2014-07-31 18:09:40

by David Vrabel

[permalink] [raw]
Subject: Re: [PATCH] xen/pciback: Fix error return code in xen_pcibk_attach()

On 20/07/14 06:46, [email protected] wrote:
> From: Wei Yongjun <[email protected]>
>
> Fix to return -EFAULT from the error handling case instead of 0 when
> version mismatch with pcifront.

Applied to devel/for-linus-3.16

Although the return value of this function is never used.

David