[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 10 Oct 2017 08:49:13 -0400
From: Boris Ostrovsky <boris.ostrovsky@...cle.com>
To: "Levin, Alexander (Sasha Levin)" <alexander.levin@...izon.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Cc: Jan Beulich <JBeulich@...e.com>
Subject: Re: [PATCH review for 4.9 31/50] xen/manage: correct return value
check on xenbus_scanf()
On 10/07/2017 06:36 PM, Levin, Alexander (Sasha Levin) wrote:
> From: Jan Beulich <JBeulich@...e.com>
>
> [ Upstream commit 4fed1b125eb6252bde478665fc05d4819f774fa8 ]
>
> A negative return value indicates an error; in fact the function at
> present won't ever return zero.
>
> Signed-off-by: Jan Beulich <jbeulich@...e.com>
> Reviewed-by: Juergen Gross <jgross@...e.com>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@...cle.com>
> Signed-off-by: Sasha Levin <alexander.levin@...izon.com>
This patch will cause a warning to be printed. Please pull commit
4e93b64 ("xen: don't print error message in case of missing Xenstore
entry") as well.
Thanks.
-boris
> ---
> drivers/xen/manage.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
> index 26e5e8507f03..357a8db859c9 100644
> --- a/drivers/xen/manage.c
> +++ b/drivers/xen/manage.c
> @@ -277,7 +277,7 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec,
> err = xenbus_transaction_start(&xbt);
> if (err)
> return;
> - if (!xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key)) {
> + if (xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key) < 0) {
> pr_err("Unable to read sysrq code in control/sysrq\n");
> xenbus_transaction_end(xbt, 1);
> return;
Powered by blists - more mailing lists