aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNayna Jain <nayna@linux.ibm.com>2021-06-20 11:13:47 -0400
committerVasant Hegde <hegdevasant@linux.vnet.ibm.com>2021-07-22 12:09:50 +0530
commit5eea157271852eaf16c59ef542a889ea6563a2d6 (patch)
tree036a5614f6e04490600c2d00d0a0f3e47dcd95c4
parent1cdde9466ab658fb5b5a53af8c4e6a8929eef698 (diff)
downloadskiboot-5eea157271852eaf16c59ef542a889ea6563a2d6.zip
skiboot-5eea157271852eaf16c59ef542a889ea6563a2d6.tar.gz
skiboot-5eea157271852eaf16c59ef542a889ea6563a2d6.tar.bz2
secvar: fix endian conversion
[ Upstream commit 5be38b672c1410e2f10acd3ad2eecfdc81d5daf7 ] unpack_timestamp() calls le32_to_cpu() for endian conversion of uint16_t "year" value. This patch fixes the code to use le16_to_cpu(). Signed-off-by: Nayna Jain <nayna@linux.ibm.com> Reviewed-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
-rw-r--r--libstb/secvar/backend/edk2-compat-process.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstb/secvar/backend/edk2-compat-process.c b/libstb/secvar/backend/edk2-compat-process.c
index 244f234..037c1b4 100644
--- a/libstb/secvar/backend/edk2-compat-process.c
+++ b/libstb/secvar/backend/edk2-compat-process.c
@@ -370,7 +370,7 @@ int update_timestamp(const char *key, const struct efi_time *timestamp, char *la
static uint64_t unpack_timestamp(const struct efi_time *timestamp)
{
uint64_t val = 0;
- uint16_t year = le32_to_cpu(timestamp->year);
+ uint16_t year = le16_to_cpu(timestamp->year);
/* pad1, nanosecond, timezone, daylight and pad2 are meant to be zero */
val |= ((uint64_t) timestamp->pad1 & 0xFF) << 0;