linux-stable/drivers/misc/mei
Alexander Usyskin 84bb0ac6c8 mei: avoid iterator usage outside of list_for_each_entry
commit c10187b1c5 upstream.

Usage of the iterator outside of the list_for_each_entry
is considered harmful. https://lkml.org/lkml/2022/2/17/1032

Do not reference the loop variable outside of the loop,
by rearranging the orders of execution.
Instead of performing search loop and checking outside the loop
if the end of the list was hit and no matching element was found,
the execution is performed inside the loop upon a successful match
followed by a goto statement to the next step,
therefore no condition has to be performed after the loop has ended.

Cc: <stable@vger.kernel.org>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20220308095926.300412-1-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-08 14:22:49 +02:00
..
hdcp mei: hdcp: SPDX tag should be the first line 2021-06-15 17:12:58 +02:00
bus-fixup.c mei: fix kdoc in the driver 2021-06-22 12:40:31 +02:00
bus.c Driver core update for 5.15-rc1 2021-09-01 08:44:42 -07:00
client.c mei: revamp mei extension header structure layout. 2021-06-22 12:40:31 +02:00
client.h mei: constify passed buffers and structures 2021-07-29 17:08:04 +02:00
debugfs.c mei: add support for client dma capability 2021-02-06 15:48:11 +01:00
dma-ring.c
hbm.c mei: hbm: fix client dma reply status 2022-01-27 11:02:56 +01:00
hbm.h mei: implement client dma setup. 2021-02-06 15:48:11 +01:00
hw-me-regs.h mei: me: add Alder Lake N device id. 2022-04-08 14:22:49 +02:00
hw-me.c mei: me: disable driver on the ign firmware 2022-04-08 14:22:49 +02:00
hw-me.h mei: add device kind to sysfs 2020-07-29 16:21:13 +02:00
hw-txe-regs.h
hw-txe.c mei: hw: use sizeof of variable instead of struct type 2020-07-23 19:33:09 +02:00
hw-txe.h
hw.h mei: revamp mei extension header structure layout. 2021-06-22 12:40:31 +02:00
init.c mei: allow clients on bus to communicate in remove callback 2021-02-06 15:48:11 +01:00
interrupt.c mei: avoid iterator usage outside of list_for_each_entry 2022-04-08 14:22:49 +02:00
Kconfig Revert "mei: virtio: virtualization frontend driver" 2020-12-06 10:36:17 +01:00
main.c mei: fix kdoc in the driver 2021-06-22 12:40:31 +02:00
Makefile Revert "mei: virtio: virtualization frontend driver" 2020-12-06 10:36:17 +01:00
mei-trace.c
mei-trace.h treewide: Add missing semicolons to __assign_str uses 2021-06-30 09:19:14 -04:00
mei_dev.h mei: constify passed buffers and structures 2021-07-29 17:08:04 +02:00
pci-me.c mei: me: add Alder Lake N device id. 2022-04-08 14:22:49 +02:00
pci-txe.c mei: fix kdoc in the driver 2021-06-22 12:40:31 +02:00