Gustavo A. R. Silva
13264260eb
ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch()
...
commit 847fb80cc01a54bc827b02547bb8743bdb59ddab 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: ba20bb126940 ("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-19 12:20:21 +02:00
..
2020-03-25 11:50:48 +01:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2023-07-27 08:43:48 +02:00
2021-06-18 10:00:04 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-10-16 08:23:26 -07:00
2019-06-19 17:09:55 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-01-23 09:12:54 -08:00
2020-08-19 10:05:39 +03:00
2019-12-12 09:42:34 -08:00
2020-05-05 11:16:06 -07:00
2020-05-05 11:16:06 -07:00
2020-08-19 10:05:39 +03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00
2020-05-19 09:38:05 -07:00
2019-10-21 10:30:54 -07:00
2019-10-16 07:51:15 -07:00
2020-03-09 10:24:01 +01:00
2021-02-17 11:02:22 +01:00
2019-06-19 17:09:55 +02:00
2019-08-12 13:17:39 -03:00
2022-08-21 15:15:34 +02:00
2019-06-19 17:09:07 +02:00
2020-08-19 10:19:13 +03:00
2019-05-30 11:26:35 -07:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:37:07 +02:00
2019-06-05 17:37:07 +02:00
2019-06-05 17:37:07 +02:00
2019-06-05 17:37:07 +02:00
2020-08-23 17:36:59 -05:00
2019-06-19 17:09:55 +02:00
2020-02-26 10:49:25 -08:00
2022-05-15 20:00:09 +02:00
2020-08-19 10:19:13 +03:00
2020-08-19 10:19:13 +03:00
2020-08-19 10:19:13 +03:00
2019-05-30 11:26:32 -07:00
2020-06-02 19:14:21 +02:00
2019-06-19 17:09:55 +02:00
2020-07-13 12:18:26 +02:00
2019-06-05 17:37:07 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2022-05-09 09:05:01 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2021-01-17 14:16:59 +01:00
2019-12-30 09:47:21 -08:00
2019-06-19 17:09:55 +02:00
2020-05-19 09:38:04 -07:00
2020-05-19 09:38:04 -07:00
2020-06-29 10:22:47 -07:00
2020-09-13 11:17:42 -07:00
2020-08-24 08:39:47 +03:00
2020-09-03 12:06:18 +03:00
2020-09-03 12:06:18 +03:00
2020-09-13 11:17:42 -07:00
2020-09-03 12:06:18 +03:00
2020-08-18 10:40:03 +03:00
2020-09-13 11:17:42 -07:00
2020-08-19 10:05:43 +03:00
2020-05-19 09:38:04 -07:00
2020-05-19 09:38:04 -07:00
2019-06-19 17:09:55 +02:00
2020-05-19 09:38:04 -07:00
2019-06-19 17:09:55 +02:00
2019-12-17 08:17:47 -08:00
2022-02-23 12:01:05 +01:00
2019-12-17 08:17:47 -08:00
2020-08-19 10:19:13 +03:00
2020-08-19 10:19:13 +03:00
2019-10-16 07:51:15 -07:00
2019-07-19 17:05:08 -07:00
2019-06-19 17:09:55 +02:00
2020-10-24 10:33:08 -07:00
2020-08-07 11:33:26 -07:00
2021-04-14 08:42:05 +02:00
2021-04-14 08:42:05 +02:00
2020-04-10 15:36:22 -07:00
2020-05-12 08:35:56 -07:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2017-11-02 11:10:55 +01:00
2020-08-19 10:19:13 +03:00
2020-08-19 10:19:13 +03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-02-26 10:03:35 -08:00
2019-12-30 09:46:34 -08:00
2021-07-25 14:36:15 +02:00
2020-10-03 13:15:05 -07:00
2019-10-16 07:51:16 -07:00
2018-07-09 23:01:34 -07:00
2020-09-24 14:26:20 +03:00
2020-09-24 14:26:20 +03:00
2020-09-24 14:26:20 +03:00
2021-04-14 08:42:05 +02:00
2019-06-19 17:09:55 +02:00
2023-09-19 12:20:21 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2022-08-21 15:15:34 +02:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:05:33 +03:00
2020-08-19 10:05:33 +03:00
2020-08-19 10:05:33 +03:00
2019-06-19 17:09:55 +02:00
2019-10-21 10:36:27 -07:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:05:33 +03:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:05:33 +03:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:35 -07:00
2020-08-19 10:19:13 +03:00
2020-04-21 09:41:53 -07:00
2020-08-19 10:19:13 +03:00
2019-07-19 17:05:08 -07:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:35 -07:00
2021-04-21 13:00:59 +02:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2023-03-11 16:39:10 +01:00
2019-06-19 17:09:55 +02:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-10-18 15:09:54 -07:00
2019-10-18 07:56:51 -07:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-08-19 10:19:13 +03:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00