drivers: char: tlclk.c: Avoid data race between init and interrupt handler
authorMadhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Fri, 17 Apr 2020 15:34:51 +0000 (21:04 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 18:40:12 +0000 (20:40 +0200)
commit73b0eb1be462ea7fdf1f8b3e514412f710a46f72
treeae7644ea7bb8b084322a5033f1d76702ee7eae3e
parent789789a6fed3a02410461d3c13791afdb3f73140
drivers: char: tlclk.c: Avoid data race between init and interrupt handler

[ Upstream commit 44b8fb6eaa7c3fb770bf1e37619cdb3902cca1fc ]

After registering character device the file operation callbacks can be
called. The open callback registers interrupt handler.
Therefore interrupt handler can execute in parallel with rest of the init
function. To avoid such data race initialize telclk_interrupt variable
and struct alarm_events before registering character device.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Link: https://lore.kernel.org/r/20200417153451.1551-1-madhuparnabhowmik10@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/char/tlclk.c