[PATCH] xen-scsifront: correct return value checks on xenbus_scanf()

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

 



Only a positive return value indicates success.

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

--- 4.7-rc6-xenbus_scanf.orig/drivers/scsi/xen-scsifront.c
+++ 4.7-rc6-xenbus_scanf/drivers/scsi/xen-scsifront.c
@@ -1000,14 +1000,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;
 
 		/*



--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux