xen: xenbus: set error code on failure
PATCH v2 1/1 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".
v1 is reviewed by: Juergen Gross <[email protected]>
--- drivers/xen/xenbus/xenbus_probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/xenbus/xenbus_probe.c +1 -1
@@ -702,7 +702,7 @@ static int __init xenbus_probe_initcall(void)*/ static int __init xenstored_local_init (void ) { -int err =0 ; +int err = -ENOMEM ;unsigned long page =0 ;struct evtchn_alloc_unbound alloc_unbound;
Signature · 8 lines
1.9.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 5 lines · Pan Bian
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".v1 is reviewed by: Juergen Gross <[email protected]>
I didn't say so.
Quoted 1 line
Signed-off-by Pan Bian <[email protected]>
Now I do:
Juergen
Quoted 10 lines
--- drivers/xen/xenbus/xenbus_probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/xen/xenbus/xenbus_probe.c +0
-0
drivers/xen/xenbus/xenbus_probe.c static int __init xenbus_probe_initcall(void) · line 708
Quoted 8 lines
drivers/xen/xenbus/xenbus_probe.c +1
-1@@ -702,7 +702,7 @@ static int __init xenbus_probe_initcall(void)*/ static int __init xenstored_local_init (void ) { -int err =0 ; +int err = -ENOMEM ;unsigned long page =0 ;struct evtchn_alloc_unbound alloc_unbound;
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerQuoted 7 lines · Pan Bian
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".v1 is reviewed by: Juergen Gross <[email protected]>
Signed-off-by Pan Bian <[email protected]>
Commited to xen/tip.git for-linus-4.10
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerQuoted 7 lines · Pan Bian
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".v1 is reviewed by: Juergen Gross <[email protected]>
Signed-off-by Pan Bian <[email protected]>
Commited to xen/tip.git for-linus-4.10
Juergen