]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rtc: pcf85063: fallback to parent of_node
authorFrancois Gervais <fgervais@distech-controls.com>
Wed, 10 Mar 2021 21:10:26 +0000 (16:10 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 May 2021 10:59:14 +0000 (12:59 +0200)
commit94d371473b7fc67f2345611ee65e354dfb2221f8
treee89cf962519ca800610c55f73a18030c5919b3f2
parent51a018320158e5536ede670ef391f44cd611fcdb
rtc: pcf85063: fallback to parent of_node

commit 03531606ef4cda25b629f500d1ffb6173b805c05 upstream.

The rtc device node is always NULL.

Since v5.12-rc1-dontuse/3c9ea42802a1fbf7ef29660ff8c6e526c58114f6 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: Francois Gervais <fgervais@distech-controls.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210310211026.27299-1-fgervais@distech-controls.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rtc/rtc-pcf85063.c