提交 e89b72d6 编写于 作者: V Vladimir Zapolskiy 提交者: Zheng Zengkai

i2c: qcom-cci: don't delete an unregistered adapter

stable inclusion
from stable-v5.10.102
commit b5b2a92117137159f0cf71f57987962c35d68f82
bugzilla: https://gitee.com/openeuler/kernel/issues/I567K6

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b5b2a92117137159f0cf71f57987962c35d68f82

--------------------------------

commit a0d48505 upstream.

If i2c_add_adapter() fails to add an I2C adapter found on QCOM CCI
controller, on error path i2c_del_adapter() is still called.

Fortunately there is a sanity check in the I2C core, so the only
visible implication is a printed debug level message:

    i2c-core: attempting to delete unregistered adapter [Qualcomm-CCI]

Nevertheless it would be reasonable to correct the probe error path.

Fixes: e5175261 ("i2c: Add Qualcomm CCI I2C driver")
Signed-off-by: NVladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Reviewed-by: NRobert Foss <robert.foss@linaro.org>
Reviewed-by: NBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: NWolfram Sang <wsa@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 2b42c300
...@@ -655,7 +655,7 @@ static int cci_probe(struct platform_device *pdev) ...@@ -655,7 +655,7 @@ static int cci_probe(struct platform_device *pdev)
return 0; return 0;
error_i2c: error_i2c:
for (; i >= 0; i--) { for (--i ; i >= 0; i--) {
if (cci->master[i].cci) if (cci->master[i].cci)
i2c_del_adapter(&cci->master[i].adap); i2c_del_adapter(&cci->master[i].adap);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册