Browse Source

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>
Pan Bian 8 years ago
parent
commit
2466d4b9d0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/xen/xenbus/xenbus_probe.c

+ 1 - 1
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;