Go to file
Laurence de Bruxelles c736ec01a2 rtc: pxa: fix null pointer dereference
commit 34127b3632b21e5c391756e724b1198eb9917981 upstream.

With the latest stable kernel versions the rtc on the PXA based
Zaurus does not work, when booting I see the following kernel messages:

pxa-rtc pxa-rtc: failed to find rtc clock source
pxa-rtc pxa-rtc: Unable to init SA1100 RTC sub-device
pxa-rtc: probe of pxa-rtc failed with error -2
hctosys: unable to open rtc device (rtc0)

I think this is because commit f2997775b1 ("rtc: sa1100: fix possible
race condition") moved the allocation of the rtc_device struct out of
sa1100_rtc_init and into sa1100_rtc_probe. This means that pxa_rtc_probe
also needs to do allocation for the rtc_device struct, otherwise
sa1100_rtc_init will try to dereference a null pointer. This patch adds
that allocation by copying how sa1100_rtc_probe in
drivers/rtc/rtc-sa1100.c does it; after the IRQs are set up a managed
rtc_device is allocated.

I've tested this patch with `qemu-system-arm -machine akita` and with a
real Zaurus SL-C1000 applied to 4.19, 5.4, and 5.10.

Signed-off-by: Laurence de Bruxelles <lfdebrux@gmail.com>
Fixes: f2997775b1 ("rtc: sa1100: fix possible race condition")
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220101154149.12026-1-lfdebrux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-27 10:54:33 +01:00
arch powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses 2022-01-27 10:54:30 +01:00
block block: Fix fsync always failed if once failed 2022-01-27 10:54:30 +01:00
certs
crypto crypto: jitter - consider 32 LSB for APT 2022-01-27 10:54:12 +01:00
Documentation Documentation: fix firewire.rst ABI file path error 2022-01-27 10:54:29 +01:00
drivers rtc: pxa: fix null pointer dereference 2022-01-27 10:54:33 +01:00
fs f2fs: fix to reserve space for IO align feature 2022-01-27 10:54:31 +01:00
include ACPICA: actypes.h: Expand the ACPI_ACCESS_ definitions 2022-01-27 10:54:18 +01:00
init bpf: Add kconfig knob for disabling unpriv bpf by default 2022-01-05 12:40:34 +01:00
ipc
kernel tracing/kprobes: 'nmissed' not showed correctly for kretprobe 2022-01-27 10:54:25 +01:00
lib lib/mpi: Add the return value check of kcalloc() 2022-01-27 10:54:02 +01:00
LICENSES
mm shmem: fix a race between shmem_unused_huge_shrink and shmem_evict_inode 2022-01-27 10:53:44 +01:00
net net/smc: Fix hung_task when removing SMC-R devices 2022-01-27 10:54:32 +01:00
samples ftrace/samples: Add missing prototypes direct functions 2022-01-11 15:25:00 +01:00
scripts recordmcount.pl: fix typo in s390 mcount regex 2022-01-05 12:40:29 +01:00
security selinux: fix potential memleak in selinux_add_opt() 2022-01-27 10:53:58 +01:00
sound ASoC: mediatek: mt8183: fix device_node leak 2022-01-27 10:54:24 +01:00
tools perf evsel: Override attr->sample_period for non-libpfm4 events 2022-01-27 10:54:30 +01:00
usr
virt KVM: downgrade two BUG_ONs to WARN_ON_ONCE 2021-12-22 09:30:50 +01:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: adjust GCC PLUGINS after gcc-plugin.sh removal 2021-12-14 11:32:46 +01:00
Makefile Linux 5.10.93 2022-01-20 09:17:52 +01:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.