Re: (subset) [PATCH] leds: pca9532: check i2c_smbus_read_byte_data() return value
From: Lee Jones
Date: Tue Sep 22 2026 - 08:52:05 EST
On Mon, 27 Jul 2026 17:57:54 +0800, haibo.chen@xxxxxxxxxxx wrote:
> Coverity report INTEGER_OVERFLOW (tainted_data_return ->
> cast_underflow -> overflow) in pca9532_getled().
> pca9532_getled() stored the return value of i2c_smbus_read_byte_data()
> into a char and used it directly to compute the LED state without
> checking for an error. i2c_smbus_read_byte_data() returns a negative
> error code on failure. On an I2C read error the negative value was
> assigned to an unsigned type, triggering an integer underflow/overflow,
> and a meaningless LED state was returned to the caller.
>
> [...]
Applied, thanks!
[1/1] leds: pca9532: check i2c_smbus_read_byte_data() return value
commit: 1b75f038e5f71ed32ce6593b5763f9776ec58a25
--
Lee Jones [李琼斯]