Skip to content

Commit b5b2a92

Browse files
Vladimir Zapolskiygregkh
authored andcommitted
i2c: qcom-cci: don't delete an unregistered adapter
commit a0d4850 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: e517526 ("i2c: Add Qualcomm CCI I2C driver") Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> Reviewed-by: Robert Foss <robert.foss@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Wolfram Sang <wsa@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3b6d25d commit b5b2a92

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/i2c/busses/i2c-qcom-cci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ static int cci_probe(struct platform_device *pdev)
655655
return 0;
656656

657657
error_i2c:
658-
for (; i >= 0; i--) {
658+
for (--i ; i >= 0; i--) {
659659
if (cci->master[i].cci)
660660
i2c_del_adapter(&cci->master[i].adap);
661661
}

0 commit comments

Comments
 (0)