Commit 69f70049 authored by Francois Gervais's avatar Francois Gervais Committed by Zheng Zengkai
Browse files

rtc: pcf85063: fallback to parent of_node



stable inclusion
from stable-5.10.40
commit 0296c9057adee577bf53f7e91f6b1178e23aeb44
bugzilla: 51882
CVE: NA

--------------------------------

commit 03531606 upstream.

The rtc device node is always NULL.

Since v5.12-rc1-dontuse/3c9ea428 this
will lead to a NULL pointer dereference.

To fix this use the parent node which is the i2c client node as set by
devm_rtc_allocate_device().

Using the i2c client node seems to be what other similar drivers do
e.g. rtc-pcf8563.c.

Signed-off-by: default avatarFrancois Gervais <fgervais@distech-controls.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210310211026.27299-1-fgervais@distech-controls.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 2513c998
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment