diff options
author | Yazen Ghannam <yazen.ghannam@amd.com> | 2024-02-22 10:54:49 -0600 |
---|---|---|
committer | Borislav Petkov (AMD) <bp@alien8.de> | 2024-02-26 13:05:12 +0100 |
commit | dd61b55d733eee9bbe51abe7ab0e6f2ce1fae332 (patch) | |
tree | 3fed97b0d10af00e6691da37a69f738600788f88 /drivers/clk/mediatek/clk-mt6765-vcodec.c | |
parent | 6f15e617cc99323339dc241d19956f0d640c4354 (diff) | |
download | lwn-dd61b55d733eee9bbe51abe7ab0e6f2ce1fae332.tar.gz lwn-dd61b55d733eee9bbe51abe7ab0e6f2ce1fae332.zip |
RAS/AMD/ATL: Fix bit overflow in denorm_addr_df4_np2()
The hash_pa8 and hashed_bit values in denorm_addr_df4_np2() are
currently defined as u8 types. These variables represent single bits.
'hash_pa8' is set based on logical AND operations using masks with more
than 8 bits. So the calculated value will not fit in this variable. It
will always be '0'. The 'hash_pa8' check later in the function will fail
which produces incorrect results for some cases.
Change these variables to bool type. This clarifies that they are
single bit values. Also, this allows the compiler to ensure they hold
the proper results. Remove an unnecessary shift operation.
[ bp: Remove the unnecessary brackets in the else-branch of the
hash_pa8 assignment. ]
Fixes: 3f3174996be6 ("RAS: Introduce AMD Address Translation Library")
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20240222165449.23582-1-yazen.ghannam@amd.com
Diffstat (limited to 'drivers/clk/mediatek/clk-mt6765-vcodec.c')
0 files changed, 0 insertions, 0 deletions