aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xenbus
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2016-12-05 16:22:22 +0800
committerJuergen Gross <jgross@suse.com>2016-12-08 07:53:57 +0100
commit2466d4b9d0c21e6c28cd63516dea65806bf5a307 (patch)
tree662e90240df2d3654ed2bb66b63b9be966571b56 /drivers/xen/xenbus
parentxen: set error code on failures (diff)
downloadlinux-dev-2466d4b9d0c21e6c28cd63516dea65806bf5a307.tar.xz
linux-dev-2466d4b9d0c21e6c28cd63516dea65806bf5a307.zip
xen: xenbus: set error code on failure
Variable err is initialized with 0. As a result, the return value may be 0 even if get_zeroed_page() fails to allocate memory. This patch fixes the bug, initializing err with "-ENOMEM". Signed-off-by: Pan Bian <bianpan2016@163.com> Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'drivers/xen/xenbus')
-rw-r--r--drivers/xen/xenbus/xenbus_probe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index b5c1dec4a7c2..4bdf654041e9 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -702,7 +702,7 @@ device_initcall(xenbus_probe_initcall);
*/
static int __init xenstored_local_init(void)
{
- int err = 0;
+ int err = -ENOMEM;
unsigned long page = 0;
struct evtchn_alloc_unbound alloc_unbound;