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:01:07 +0000 (12:01 +0100)
commite3fdbc40b7501f3822327d83e039e71d107117ff
treec2ab63a1b303a99a858aab933563ae86516a2a4e
parentb5b2a92117137159f0cf71f57987962c35d68f82
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