OSDN Git Service

efiboot: fix a bad error check
authorPeter Jones <pjones@redhat.com>
Thu, 21 Jun 2018 17:55:45 +0000 (13:55 -0400)
committerPeter Jones <pjones@redhat.com>
Thu, 21 Jun 2018 19:36:33 +0000 (15:36 -0400)
Signed-off-by: Peter Jones <pjones@redhat.com>
src/linux-acpi.c

index 3eac526..88f0084 100644 (file)
@@ -93,7 +93,7 @@ hid_err:
         errno = 0;
         fbuf = NULL;
         rc = read_sysfs_file(&fbuf, "%s/firmware_node/uid", path);
-        if ((rc <= 0 && errno != ENOENT) || fbuf == NULL) {
+        if ((rc < 0 && errno != ENOENT) || (rc > 0 && fbuf == NULL)) {
                 efi_error("could not read %s/firmware_node/uid", path);
                 return -1;
         }