Skip to content

Commit 2466d4b

Browse files
SinkFinderjgross1
authored andcommitted
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>
1 parent 0fdb474 commit 2466d4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/xen/xenbus/xenbus_probe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ device_initcall(xenbus_probe_initcall);
702702
*/
703703
static int __init xenstored_local_init(void)
704704
{
705-
int err = 0;
705+
int err = -ENOMEM;
706706
unsigned long page = 0;
707707
struct evtchn_alloc_unbound alloc_unbound;
708708

0 commit comments

Comments
 (0)