i2c: rcar: avoid race when unregistering slave client
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 8 Aug 2019 19:39:10 +0000 (21:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Sep 2019 08:20:45 +0000 (10:20 +0200)
commit72cbbaa9079ca55456084b6bf35df53b5add0467
treed81d7453ba9cfe6b105fe7f70de6dbbbc56b4e2d
parent82d31c50aff90f2c7be4ac2a644368223971f431
i2c: rcar: avoid race when unregistering slave client

[ Upstream commit 7b814d852af6944657c2961039f404c4490771c0 ]

After we disabled interrupts, there might still be an active one
running. Sync before clearing the pointer to the slave device.

Fixes: de20d1857dd6 ("i2c: rcar: add slave support")
Reported-by: Krzysztof Adamski <krzysztof.adamski@nokia.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Krzysztof Adamski <krzysztof.adamski@nokia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-rcar.c