]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: pl031: fix rtc features null pointer dereference
authorAli Pouladi <quic_apouladi@quicinc.com>
Fri, 25 Feb 2022 16:19:24 +0000 (08:19 -0800)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 23 Mar 2022 18:58:37 +0000 (19:58 +0100)
commite957b31b43a4cfb54328f04161c4409e3bb39f64
tree9fa61c0b42103efbe1f70424b0595417ce09ba93
parentca1f27a10ee873980802ac773d1c5d7c213eb1a4
rtc: pl031: fix rtc features null pointer dereference

When there is no interrupt line, rtc alarm feature is disabled.

The clearing of the alarm feature bit was being done prior to allocations
of ldata->rtc device, resulting in a null pointer dereference.

Clear RTC_FEATURE_ALARM after the rtc device is allocated.

Fixes: 1baa631ecda4 ("rtc: pl031: use RTC_FEATURE_ALARM")
Cc: stable@vger.kernel.org
Signed-off-by: Ali Pouladi <quic_apouladi@quicinc.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220225161924.274141-1-quic_eberman@quicinc.com
drivers/rtc/rtc-pl031.c