Commit f0f6d8ee authored by Darrick J. Wong's avatar Darrick J. Wong Committed by Zheng Zengkai
Browse files

ics932s401: fix broken handling of errors when word reading fails



stable inclusion
from stable-5.10.40
commit 33a9ff900b9b03997aabf0dba887b11f93c2f47c
bugzilla: 51882
CVE: NA

--------------------------------

commit a73b6a3b upstream.

In commit b05ae01f, someone tried to make the driver handle i2c read
errors by simply zeroing out the register contents, but for some reason
left unaltered the code that sets the cached register value the function
call return value.

The original patch was authored by a member of the Underhanded
Mangle-happy Nerds, I'm not terribly surprised.  I don't have the
hardware anymore so I can't test this, but it seems like a pretty
obvious API usage fix to me...

Fixes: b05ae01f ("misc/ics932s401: Add a missing check to i2c_smbus_read_word_data")
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20210428222534.GJ3122264@magnolia


Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 66776187
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment