| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] xen-tpmfront: correct return value check on xenbus_scanf()
 Only a positive return value indicates success.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 drivers/char/tpm/xen-tpmfront.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--- 4.7-rc6-xenbus_scanf.orig/drivers/char/tpm/xen-tpmfront.c
+++ 4.7-rc6-xenbus_scanf/drivers/char/tpm/xen-tpmfront.c
@@ -344,7 +344,7 @@ static void backend_changed(struct xenbu
                        break;
 
                if (xenbus_scanf(XBT_NIL, dev->otherend,
-                               "feature-protocol-v2", "%d", &val) < 0)
+                               "feature-protocol-v2", "%d", &val) <= 0)
                        val = 0;
                if (!val) {
                        xenbus_dev_fatal(dev, -EINVAL,
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |