[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] scsifront: correct return value checks on xenbus_scanf()


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
  • Date: Fri, 08 Jul 2016 08:44:02 +0000
  • Delivery-date: Fri, 08 Jul 2016 08:44:08 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1467966437 -7200
#      Fri Jul 08 10:27:17 2016 +0200
# Node ID 4930cfc7042b517ffd3bcfc7346ab53da3fe8c32
# Parent  3e56ca08a5e9c788c03f9ddf707d9d1c4735364f
scsifront: correct return value checks on xenbus_scanf()

Only a positive return value is guaranteed to indicates success.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Juergen Gross <jgross@xxxxxxxx>
---


diff -r 3e56ca08a5e9 -r 4930cfc7042b drivers/xen/scsifront/xenbus.c
--- a/drivers/xen/scsifront/xenbus.c    Fri Jul 08 10:26:28 2016 +0200
+++ b/drivers/xen/scsifront/xenbus.c    Fri Jul 08 10:27:17 2016 +0200
@@ -362,14 +362,14 @@ static void scsifront_do_lun_hotplug(str
                snprintf(str, sizeof(str), "vscsi-devs/%s/state", dir[i]);
                err = xenbus_scanf(XBT_NIL, dev->otherend, str, "%u",
                        &device_state);
-               if (XENBUS_EXIST_ERR(err))
+               if (err <= 0)
                        continue;
                
                /* virtual SCSI device */
                snprintf(str, sizeof(str), "vscsi-devs/%s/v-dev", dir[i]);
                err = xenbus_scanf(XBT_NIL, dev->otherend, str,
                        "%u:%u:%u:%u", &hst, &chn, &tgt, &lun);
-               if (XENBUS_EXIST_ERR(err))
+               if (err != 4)
                        continue;
 
                /* front device state path */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.