OpenCloudOS-Kernel/arch/powerpc/platforms/book3s
Gustavo A. R. Silva 61cb9ac66b powerpc/vas: Fix potential NULL pointer dereference
(!ptr && !ptr->foo) strikes again. :)

The expression (!ptr && !ptr->foo) is bogus and in case ptr is NULL,
it leads to a NULL pointer dereference: ptr->foo.

Fix this by converting && to ||

This issue was detected with the help of Coccinelle, and audited and
fixed manually.

Fixes: 1a0d0d5ed5 ("powerpc/vas: Add platform specific user window operations")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211015050345.GA1161918@embeddedor
2021-10-22 15:22:04 +11:00
..
Kconfig powerpc/vas: Move VAS API to book3s common platform 2021-06-20 21:58:55 +10:00
Makefile powerpc/vas: Move VAS API to book3s common platform 2021-06-20 21:58:55 +10:00
vas-api.c powerpc/vas: Fix potential NULL pointer dereference 2021-10-22 15:22:04 +11:00