acrn-kernel/arch/arm
Gustavo A. R. Silva 7a7f112833 ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch()
commit 847fb80cc0 upstream.

If function pwrdm_read_prev_pwrst() returns -EINVAL, we will end
up accessing array pwrdm->state_counter through negative index
-22. This is wrong and the compiler is legitimately warning us
about this potential problem.

Fix this by sanity checking the value stored in variable _prev_
before accessing array pwrdm->state_counter.

Address the following -Warray-bounds warning:
arch/arm/mach-omap2/powerdomain.c:178:45: warning: array subscript -22 is below array bounds of 'unsigned int[4]' [-Warray-bounds]

Link: https://github.com/KSPP/linux/issues/307
Fixes: ba20bb1269 ("OMAP: PM counter infrastructure.")
Cc: stable@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/lkml/20230607050639.LzbPn%25lkp@intel.com/
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Message-ID: <ZIFVGwImU3kpaGeH@work>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-13 09:43:00 +02:00
..
boot ARM: dts: qcom: ipq4019: correct SDHCI XO clock 2023-09-13 09:42:43 +02:00
common
configs ARM: bcm2835_defconfig: Enable the framebuffer 2023-03-10 09:32:38 +01:00
crypto
include ARM: ptrace: Restore syscall skipping for tracers 2023-09-13 09:42:28 +02:00
kernel ARM: ptrace: Restore syscall skipping for tracers 2023-09-13 09:42:28 +02:00
lib locking/atomic: arm: fix sync ops 2023-07-19 16:21:02 +02:00
mach-actions
mach-airoha
mach-alpine
mach-artpec
mach-asm9260
mach-aspeed
mach-at91 ARM: at91: pm: fix imbalanced reference counter for ethernet devices 2023-06-14 11:15:29 +02:00
mach-axxia
mach-bcm
mach-berlin
mach-clps711x
mach-cns3xxx
mach-davinci
mach-digicolor
mach-dove
mach-ep93xx ARM: ep93xx: fix missing-prototype warnings 2023-07-19 16:21:23 +02:00
mach-exynos
mach-footbridge
mach-gemini
mach-highbank
mach-hisi
mach-hpe
mach-imx ARM: imx: Call ida_simple_remove() for ida_simple_get 2023-03-10 09:32:38 +01:00
mach-iop32x
mach-ixp4xx
mach-keystone
mach-lpc18xx
mach-lpc32xx
mach-mediatek
mach-meson
mach-milbeaut
mach-mmp
mach-moxart
mach-mstar
mach-mv78xx0
mach-mvebu
mach-mxs
mach-nomadik
mach-npcm
mach-nspire
mach-omap1 ARM: OMAP1: call platform_device_put() in error case in omap1_dm_timer_init() 2023-03-10 09:32:38 +01:00
mach-omap2 ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch() 2023-09-13 09:43:00 +02:00
mach-orion5x ARM: orion5x: fix d2net gpio initialization 2023-07-19 16:22:14 +02:00
mach-oxnas
mach-pxa ARM: pxa: remove use of symbol_get() 2023-09-06 21:26:59 +01:00
mach-qcom
mach-rda
mach-realtek
mach-rockchip
mach-rpc
mach-s3c ARM: s3c: fix s3c64xx_set_timer_source prototype 2023-03-10 09:32:38 +01:00
mach-s5pv210
mach-sa1100 ARM: 9296/1: HP Jornada 7XX: fix kernel-doc warnings 2023-05-24 17:32:31 +01:00
mach-shmobile
mach-socfpga
mach-spear
mach-sti
mach-stm32
mach-sunplus
mach-sunxi
mach-tegra
mach-uniphier
mach-ux500
mach-versatile
mach-vt8500
mach-zynq ARM: zynq: Fix refcount leak in zynq_early_slcr_init 2023-03-10 09:32:33 +01:00
mm arm/mm: Convert to using lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
net
nwfpe
plat-orion
probes ARM: 9303/1: kprobes: avoid missing-declaration warnings 2023-07-19 16:21:01 +02:00
tools
vdso
vfp
xen
Kbuild
Kconfig ARM: cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:46 +02:00
Kconfig-nommu
Kconfig.assembler
Kconfig.debug
Makefile