]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
xen: xenbus: set error code on failure
authorPan Bian <bianpan2016@163.com>
Mon, 5 Dec 2016 08:22:22 +0000 (16:22 +0800)
committerJuergen Gross <jgross@suse.com>
Thu, 8 Dec 2016 06:53:57 +0000 (07:53 +0100)
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>
drivers/xen/xenbus/xenbus_probe.c

index b5c1dec4a7c2d3623f5efc9b8a02d5051797faca..4bdf654041e98c6f6485c18d8d5c704f46165a79 100644 (file)
@@ -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;