Skip to content

Commit 3693cba

Browse files
committed
memory-id: fix never hit condition
As sizeof(int64_t) is always 8.
1 parent 9bd6ee8 commit 3693cba

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/udev/dmi_memory_id/dmi_memory_id.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,11 @@ static int smbios3_decode(const uint8_t *buf, const char *devmem, bool no_file_o
602602
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to verify checksum.");
603603

604604
offset = QWORD(buf + 0x10);
605-
if (!no_file_offset && (offset >> 32) != 0 && sizeof(int64_t) < 8)
606-
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "64-bit addresses not supported.");
605+
606+
#if __SIZEOF_SIZE_T__ != 8
607+
if (!no_file_offset && (offset >> 32) != 0)
608+
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "64-bit addresses not supported on 32-bit systems.");
609+
#endif
607610

608611
return dmi_table(offset, DWORD(buf + 0x0C), 0, devmem, no_file_offset);
609612
}

0 commit comments

Comments
 (0)