[Xen-devel] [PATCH 1/1 v2] xen: set error code on failures

2016-12-05 Thread Pan Bian
alloc_page() returns NULL, and removing the initialization of rc outside of the loop. v1 is reviewed by: Juergen Gross Signed-off-by: Pan Bian --- drivers/xen/gntalloc.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntall

[Xen-devel] [PATCH 1/1 v2] xen: xenbus: set error code on failure

2016-12-05 Thread 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 Signed-off-by: Pan Bian --- drivers/xen/xenbus/xenbus_probe.c

Re: [Xen-devel] [PATCH 1/1] xen: xenbus: set error code on failure

2016-12-04 Thread Pan Bian
From: PanBian On Mon, Dec 05, 2016 at 07:30:49AM +0100, Juergen Gross wrote: > On 03/12/16 11:49, Pan Bian wrote: > > In function xenstored_local_init(), the value of return variable err > > should be negative on errors. But the value of err keeps 0 even if the > > ca

[Xen-devel] [PATCH 1/1] xen: set error code on failures

2016-12-04 Thread Pan Bian
From: Pan Bian The return variable rc is initialized with "-ENOMEM" outside the loop. However, it is reset in the loop, and its value is not negative during the second or after repeat of the loop. If kzalloc() fails then, it will return 0. This patch fixes the bug, assigning "

[Xen-devel] [PATCH 1/1] xen: xenbus: set error code on failure

2016-12-03 Thread Pan Bian
kernel.org/show_bug.cgi?id=188721 Signed-off-by: Pan Bian --- drivers/xen/xenbus/xenbus_probe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index 33a31cf..f87d047 100644 --- a/drivers/xen/xenbus/xenbus_pro