xen-scsifront: correct return value checks on xenbus_scanf()
A message that is not in the archive (sent off-list or not yet received): [email protected]
Juergen Gross
Acked-byQuoted 3 lines · Jan Beulich
Only a positive return value indicates success.
Signed-off-by Jan Beulich <[email protected]>
Acked-by Juergen Gross <[email protected]>
Quoted 25 lines
--- drivers/scsi/xen-scsifront.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/scsi/xen-scsifront.c +2
-2@@ -1000,14 +1000,14 @@ static void scsifront_do_lun_hotplug(strsnprintf (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 ;/*
Juergen Gross
Acked-byQuoted 3 lines · Jan Beulich
Only a positive return value indicates success.
Signed-off-by Jan Beulich <[email protected]>
Acked-by Juergen Gross <[email protected]>
Quoted 15 lines
--- drivers/scsi/xen-scsifront.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/scsi/xen-scsifront.c +1
-1@@ -1000,14 +1000,14 @@ static void scsifront_do_lun_hotplug(strsnprintf (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 ;
drivers/scsi/xen-scsifront.c static void scsifront_do_lun_hotplug(str · line 1013
Quoted 10 lines
drivers/scsi/xen-scsifront.c +1
-1/* 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 ;/*
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel