rtc: hym8563: fix a missing check of block data read
authorKangjie Lu <kjlu@umn.edu>
Wed, 26 Dec 2018 03:09:11 +0000 (21:09 -0600)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 22 Jan 2019 18:03:43 +0000 (19:03 +0100)
commit9a20b5e35a536d6bb4b2d4a3b14a0457e205356c
tree2e9c4093c1e645bb9784df16383f292cac1ab43b
parent5910fa0d0d9809c4d8fbf1fb905a8c86fbf2eccb
rtc: hym8563: fix a missing check of block data read

When i2c_smbus_read_i2c_block_data() fails, the read data in "buf" could
be incorrect and should not be used. The fix checks if
i2c_smbus_read_i2c_block_data fails, and if so, return its error code
upstream.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-hym8563.c