mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Jan Beulich <JBeulich@suse.com>, Jan Beulich <jbeulich@suse.com>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Subject: [PATCH review for 3.18 07/12] xen/manage: correct return value check on xenbus_scanf()
Date: Sat, 7 Oct 2017 22:38:00 +0000	[thread overview]
Message-ID: <20171007223752.25085-7-alexander.levin@verizon.com> (raw)
In-Reply-To: <20171007223752.25085-1-alexander.levin@verizon.com>

From: Jan Beulich <JBeulich@suse.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@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 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 bf1940706422..f905ba624b8d 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -272,7 +272,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;
-- 
2.11.0

  parent reply	other threads:[~2017-10-07 22:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-07 22:37 [PATCH review for 3.18 01/12] mmc: s3cmci: include linux/interrupt.h for tasklet_struct Levin, Alexander (Sasha Levin)
2017-10-07 22:37 ` [PATCH review for 3.18 03/12] ext4: fix stripe-unaligned allocations Levin, Alexander (Sasha Levin)
2017-10-07 22:37 ` [PATCH review for 3.18 02/12] staging: rtl8712u: Fix endian settings for structs describing network packets Levin, Alexander (Sasha Levin)
2017-10-07 22:37 ` [PATCH review for 3.18 04/12] ext4: do not use stripe_width if it is not set Levin, Alexander (Sasha Levin)
2017-10-07 22:38 ` Levin, Alexander (Sasha Levin) [this message]
2017-10-07 22:38 ` [PATCH review for 3.18 08/12] platform/x86: intel_mid_thermal: Fix module autoload Levin, Alexander (Sasha Levin)
2017-10-07 22:38 ` [PATCH review for 3.18 06/12] [media] cx231xx: Fix I2C on Internal Master 3 Bus Levin, Alexander (Sasha Levin)
2017-10-07 22:38 ` [PATCH review for 3.18 05/12] i2c: riic: correctly finish transfers Levin, Alexander (Sasha Levin)
2017-10-07 22:38 ` [PATCH review for 3.18 10/12] staging: lustre: ptlrpc: skip lock if export failed Levin, Alexander (Sasha Levin)
2017-10-07 22:38 ` [PATCH review for 3.18 11/12] s390/dasd: check for device error pointer within state change interrupts Levin, Alexander (Sasha Levin)
2017-10-07 22:38 ` [PATCH review for 3.18 09/12] staging: lustre: hsm: stack overrun in hai_dump_data_field Levin, Alexander (Sasha Levin)
2017-10-07 22:38 ` [PATCH review for 3.18 12/12] [media] bt8xx: fix memory leak Levin, Alexander (Sasha Levin)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171007223752.25085-7-alexander.levin@verizon.com \
    --to=alexander.levin@verizon.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®