summaryrefslogtreecommitdiff
path: root/drivers/virt/fsl_hypervisor.c
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2022-03-08 11:59:26 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-18 13:48:30 +0100
commitc10187b1c5ebb8681ca467ab7b0ded5ea415d258 (patch)
tree5d9454b05f1f302a29ff9771799cbb475509f18e /drivers/virt/fsl_hypervisor.c
parent7bbbd0845818cffa9fa8ccfe52fa1cad58e7e4f2 (diff)
mei: avoid iterator usage outside of list_for_each_entry
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>
Diffstat (limited to 'drivers/virt/fsl_hypervisor.c')
0 files changed, 0 insertions, 0 deletions