xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Juergen Gross <JGross@suse.com>
Cc: xen-devel@lists.xenproject.org, linux-scsi@vger.kernel.org
Subject: [PATCH] xen-scsiback: correct return value checks on xenbus_scanf()
Date: Thu, 07 Jul 2016 02:01:12 -0600	[thread overview]
Message-ID: <577E286802000078000FBECF__11202.2541267381$1467878537$gmane$org@prv-mh.provo.novell.com> (raw)

Only a positive return value indicates success.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 drivers/xen/xen-scsiback.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- 4.7-rc6-xenbus_scanf.orig/drivers/xen/xen-scsiback.c
+++ 4.7-rc6-xenbus_scanf/drivers/xen/xen-scsiback.c
@@ -1071,7 +1071,7 @@ static void scsiback_do_1lun_hotplug(str
 	/* read status */
 	snprintf(state, sizeof(state), "vscsi-devs/%s/state", ent);
 	err = xenbus_scanf(XBT_NIL, dev->nodename, state, "%u", &device_state);
-	if (XENBUS_EXIST_ERR(err))
+	if (err <= 0)
 		return;
 
 	/* physical SCSI device */
@@ -1089,7 +1089,7 @@ static void scsiback_do_1lun_hotplug(str
 	snprintf(str, sizeof(str), "vscsi-devs/%s/v-dev", ent);
 	err = xenbus_scanf(XBT_NIL, dev->nodename, str, "%u:%u:%u:%u",
 			   &vir.hst, &vir.chn, &vir.tgt, &vir.lun);
-	if (XENBUS_EXIST_ERR(err)) {
+	if (err != 4) {
 		xenbus_printf(XBT_NIL, dev->nodename, state,
 			      "%d", XenbusStateClosed);
 		return;




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

             reply	other threads:[~2016-07-07  8:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-07  8:01 Jan Beulich [this message]
     [not found] <577E286802000078000FBECF@suse.com>
2016-07-07 12:34 ` [PATCH] xen-scsiback: correct return value checks on xenbus_scanf() Juergen Gross

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='577E286802000078000FBECF__11202.2541267381$1467878537$gmane$org@prv-mh.provo.novell.com' \
    --to=jbeulich@suse.com \
    --cc=JGross@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).