Commit b55d073
power: supply: bq256xx: fix some problem in bq256xx_hw_init
smatch complains that there is a buffer overflow and clang complains
'ret' is never read.
Smatch error:
drivers/power/supply/bq256xx_charger.c:1578 bq256xx_hw_init() error:
buffer overflow 'bq256xx_watchdog_time' 4 <= 4
Clang static checker:
Value stored to 'ret' is never read.
Add check for buffer overflow and error code from regmap_update_bits().
Fixes: 32e4978 ("power: supply: bq256xx: Introduce the BQ256XX charger driver")
Signed-off-by: Su Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20231116041822.1378758-1-suhui@nfschina.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>1 parent 054eb23 commit b55d073
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1574 | 1574 | | |
1575 | 1575 | | |
1576 | 1576 | | |
1577 | | - | |
| 1577 | + | |
| 1578 | + | |
1578 | 1579 | | |
1579 | 1580 | | |
1580 | 1581 | | |
1581 | 1582 | | |
1582 | 1583 | | |
1583 | 1584 | | |
| 1585 | + | |
| 1586 | + | |
1584 | 1587 | | |
1585 | 1588 | | |
1586 | 1589 | | |
| |||
0 commit comments