diff options
author | Jiri Slaby <jslaby@suse.cz> | 2021-01-05 15:02:34 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-07 13:25:57 +0300 |
commit | 0fdb8c22e90b229edfe2c669880db4ff39bada69 (patch) | |
tree | 6ed07fe9a3b8e3e565d0b17902dd31f93d074786 /drivers | |
parent | c1a98acf681f11574d9a965c843f08b6537e2998 (diff) | |
download | linux-0fdb8c22e90b229edfe2c669880db4ff39bada69.tar.xz |
vt/consolemap: do font sum unsigned
[ Upstream commit 9777f8e60e718f7b022a94f2524f967d8def1931 ]
The constant 20 makes the font sum computation signed which can lead to
sign extensions and signed wraps. It's not much of a problem as we build
with -fno-strict-overflow. But if we ever decide not to, be ready, so
switch the constant to unsigned.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210105120239.28031-7-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/vt/consolemap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c index 9d7ab7b66a8a..3e668d7c4b57 100644 --- a/drivers/tty/vt/consolemap.c +++ b/drivers/tty/vt/consolemap.c @@ -494,7 +494,7 @@ con_insert_unipair(struct uni_pagedir *p, u_short unicode, u_short fontpos) p2[unicode & 0x3f] = fontpos; - p->sum += (fontpos << 20) + unicode; + p->sum += (fontpos << 20U) + unicode; return 0; } |