]> git.baikalelectronics.ru Git - kernel.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>
Thu, 13 May 2021 15:21:54 +0000 (17:21 +0200)
commit0a3e8568f8cc9bff404b19aa555ae21f37e34299
tree05300aa42e420457204ea52acb729f37ceb0f025
parentaa31060bb6d94ebc092a277d3c84252438405a7e
ics932s401: fix broken handling of errors when word reading fails

In commit c1bbaebda0da, 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: c1bbaebda0da ("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