]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ics932s401: fix broken handling of errors when word reading fails
authorDarrick J. Wong <djwong@kernel.org>
Wed, 28 Apr 2021 22:25:34 +0000 (15:25 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 May 2021 10:59:13 +0000 (12:59 +0200)
commit4c1c304a77c274e767481dbbe4587eb3685aa0cd
treec54eabc635d0cbf76acb0076ba4c151519c0ab9a
parent10d0a8d1b9a4924d3a1058122883e77a2f2963b9
ics932s401: fix broken handling of errors when word reading fails

commit a73b6a3b4109ce2ed01dbc51a6c1551a6431b53c upstream.

In commit b05ae01fdb89, 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: b05ae01fdb89 ("misc/ics932s401: Add a missing check to i2c_smbus_read_word_data")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20210428222534.GJ3122264@magnolia
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/ics932s401.c