Re: [PATCH] tools thermal tmon: Fix signed shift UB in binding display

From: Daniel Lezcano

Date: Mon Sep 28 2026 - 12:49:55 EST


On 9/3/26 10:28, liujing wrote:
From: Liu Jing <liujing@xxxxxxxxxxxxxxxxxxxx>

In the thermal zone binding display loop, the expression `(1 << j)`
performs a signed integer shift. When j reaches 31, this sets the
sign bit of a 32-bit signed integer, which is undefined behavior.

Fix it by using `(1U << j)` to perform an unsigned shift.

Signed-off-by: Liu Jing <liujing@xxxxxxxxxxxxxxxxxxxx>
---
Applied, thanks