i2c: qcom-cci: don't put a device tree node before i2c_add_adapter()
authorVladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Thu, 3 Feb 2022 16:47:03 +0000 (18:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Feb 2022 11:03:21 +0000 (12:03 +0100)
commit8641ceb41f3055cabef3a92d63b19aa5ff3437c3
tree8ab878c5b614dd29bfa10da1ce2a77fa13da61e8
parent7512f91bc3133043c452ecbee55bce0c065b9cc2
i2c: qcom-cci: don't put a device tree node before i2c_add_adapter()

commit 02a4a69667a2ad32f3b52ca906f19628fbdd8a01 upstream.

There is a minor chance for a race, if a pointer to an i2c-bus subnode
is stored and then reused after releasing its reference, and it would
be sufficient to get one more reference under a loop over children
subnodes.

Fixes: e517526195de ("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>
drivers/i2c/busses/i2c-qcom-cci.c