i2c: mv64xxx: Fix check for missing clock
PATCH 1/1 i2c: mv64xxx: Fix check for missing clock
In commit e5c02cf54154 ("i2c: mv64xxx: Add runtime PM support"), error pointers to optional clocks were replaced by NULL to simplify the resume callback implementation. However, that commit missed that the IS_ERR check in mv64xxx_of_config should be replaced with a NULL check. As a result, the check always passes, even for an invalid device tree.
--- drivers/i2c/busses/i2c-mv64xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-mv64xxx.c +1 -1
@@ -813,7 +813,7 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,* need to know tclk in order to calculate bus clock * factors. */ -if (IS_ERR (drv_data->clk)) { +if (!drv_data->clk) { rc = -ENODEV ; goto out; }
Signature · 1 line
2.26.2
Quoted 9 lines · Samuel Holland
In commit
e5c02cf54154("i2c: mv64xxx: Add runtime PM support"), error pointers to optional clocks were replaced by NULL to simplify the resume callback implementation. However, that commit missed that theIS_ERRcheck inmv64xxx_of_configshould be replaced with a NULL check. As a result, the check always passes, even for an invalid device tree.Fixes e5c02cf54154 ("i2c: mv64xxx: Add runtime PM support")Reported-by Dan Carpenter <[email protected]>Signed-off-by Samuel Holland <[email protected]>
Added "RPM" to $subject and applied to for-next, thanks!