linux/arch/powerpc
Xiaomeng Tong 300981abdd KVM: PPC: Book3S HV: fix incorrect NULL check on list iterator
The bug is here:
	if (!p)
                return ret;

The list iterator value 'p' will *always* be set and non-NULL by
list_for_each_entry(), so it is incorrect to assume that the iterator
value will be NULL if the list is empty or no element is found.

To fix the bug, Use a new value 'iter' as the list iterator, while use
the old value 'p' as a dedicated variable to point to the found element.

Fixes: dfaa973ae9 ("KVM: PPC: Book3S HV: In H_SVM_INIT_DONE, migrate remaining normal-GFNs to secure-GFNs")
Cc: stable@vger.kernel.org # v5.9+
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220414062103.8153-1-xiam0nd.tong@gmail.com
2022-05-18 23:31:35 +10:00
..
boot powerpc/boot: Add otheros-too-big.bld to .gitignore 2022-02-15 22:29:52 +11:00
configs arch: Remove references to CONFIG_NFSD_V3 in the default configs 2022-03-11 10:25:16 -05:00
crypto powerpc updates for 5.17 2022-01-14 15:17:26 +01:00
include KVM: PPC: Book3S HV P9: Move cede logic out of XIVE escalation rearming 2022-05-13 21:34:33 +10:00
kernel powerpc fixes for 5.18 #2 2022-04-10 07:36:18 -10:00
kexec powerpc: Move C prototypes out of asm-prototypes.h 2022-03-08 22:06:25 +11:00
kvm KVM: PPC: Book3S HV: fix incorrect NULL check on list iterator 2022-05-18 23:31:35 +10:00
lib powerpc updates for 5.18 2022-03-25 09:39:36 -07:00
math-emu powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
mm KVM: PPC: Book3S HV: Update LPID allocator init for POWER9, Nested 2022-05-13 21:33:33 +10:00
net powerpc updates for 5.18 2022-03-25 09:39:36 -07:00
perf powerpc: declare unmodified attribute_group usages const 2022-03-08 22:15:32 +11:00
platforms Driver core changes for 5.18-rc2 2022-04-10 09:55:09 -10:00
purgatory powerpc/kexec: Don't use .machine ppc64 in trampoline_64.S 2021-04-08 21:17:43 +10:00
sysdev pci-v5.18-changes 2022-03-25 13:02:05 -07:00
tools powerpc/64: Add UADDR64 relocation support 2022-03-09 21:47:53 +11:00
xmon powerpc/xmon: Dump XIVE information for online-only processors. 2022-01-06 21:47:00 +11:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig powerpc updates for 5.18 2022-03-25 09:39:36 -07:00
Kconfig.debug powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP 2021-08-25 13:35:48 +10:00
Makefile Merge branch 'topic/func-desc-lkdtm' into next 2022-03-07 23:34:32 +11:00
Makefile.postlink powerpc: unrel_branch_check.sh: use nm to find symbol value 2020-09-02 11:00:22 +10:00