realtek: don't unmask non-maskable GPIO IRQs
authorSander Vanheule <sander@svanheule.net>
Sun, 29 May 2022 17:38:09 +0000 (19:38 +0200)
committerSander Vanheule <sander@svanheule.net>
Mon, 30 May 2022 05:21:03 +0000 (07:21 +0200)
commitbde6311569ef25a00c3beaeabfd6b78b19651872
tree8d2cc1ce3fd2bc7776959f2882ba0152923f895e
parent4bed263af7a13cb4b9401f7ae04f788cfcc234f7
realtek: don't unmask non-maskable GPIO IRQs

On uniprocessor builds, for_each_cpu(cpu, mask) will assume 'mask'
always contains exactly one CPU, and ignore the actual mask contents.
This causes the loop to run, even when it shouldn't on an empty mask,
and tries to access an uninitialised pointer.

Fix this by wrapping the loop in a cpumask_empty() check, to ensure it
will not run on uniprocessor builds if the CPU mask is empty.

Fixes: af6cd37f42f3 ("realtek: replace RTL93xx GPIO patches")
Reported-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reported-by: Robert Marko <robimarko@gmail.com>
Tested-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
target/linux/realtek/patches-5.10/316-otto-gpio-uniprocessor-irq-mask.patch [new file with mode: 0644]