WSL2-Linux-Kernel/arch/powerpc/platforms
Colin Ian King d3a0d96c16 powerpc/powernv/sriov: perform null check on iov before dereferencing iov
[ Upstream commit f4f913c980 ]

Currently pointer iov is being dereferenced before the null check of iov
which can lead to null pointer dereference errors. Fix this by moving the
iov null check before the dereferencing.

Detected using cppcheck static analysis:
linux/arch/powerpc/platforms/powernv/pci-sriov.c:597:12: warning: Either
the condition '!iov' is redundant or there is possible null pointer
dereference: iov. [nullPointerRedundantCheck]
 num_vfs = iov->num_vfs;
           ^

Fixes: 052da31d45 ("powerpc/powernv/sriov: De-indent setup and teardown")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230608095849.1147969-1-colin.i.king@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-23 13:47:13 +02:00
..
4xx powerpc/4xx/cpm: Fix return value of __setup() handler 2022-06-09 10:23:10 +02:00
8xx powerpc/8xx: export 'cpm_setbrg' for modules 2022-06-09 10:23:09 +02:00
40x
44x powerpc/44x/fsp2: add missing of_node_put 2021-11-18 19:16:57 +01:00
52xx powerpc/52xx: Fix a resource leak in an error handling path 2022-12-31 13:14:35 +01:00
82xx powerpc: Bulk conversion to generic_handle_domain_irq() 2021-08-12 11:39:41 +01:00
83xx powerpc/83xx/mpc832x_rdb: call platform_device_put() in error case in of_fsl_spi_probe() 2022-12-31 13:14:35 +01:00
85xx powerpc/85xx: Fix oops when CONFIG_FSL_PMC=n 2021-12-22 09:32:45 +01:00
86xx powerpc: retire sbc8641d board support 2021-08-27 00:48:18 +10:00
512x powerpc/mpc512x: fix resource printk format warning 2023-05-11 23:00:34 +09:00
amigaone powerpc/amigaone: Make amigaone_discover_phbs() static 2021-02-11 23:28:51 +11:00
book3s powerpc/vas: Fix potential NULL pointer dereference 2021-11-18 19:17:19 +01:00
cell powerpc/cell/axon_msi: Fix refcount leak in setup_msi_msg_address 2022-08-17 14:24:13 +02:00
chrp powerpc/chrp: Make hydra_init() static 2021-03-24 14:09:29 +11:00
embedded6xx powerpc/wii: fix resource printk format warnings 2023-05-11 23:00:34 +09:00
maple powerpc/pci: fix warning comparing pointer to 0 2021-03-29 13:22:13 +11:00
microwatt powerpc/microwatt: wire up rng during setup_arch() 2022-06-29 09:03:30 +02:00
pasemi powerpc updates for 5.15 2021-09-03 11:22:50 -07:00
powermac powerpc/mm: Switch obsolete dssall to .long 2022-06-14 18:36:27 +02:00
powernv powerpc/powernv/sriov: perform null check on iov before dereferencing iov 2023-07-23 13:47:13 +02:00
ps3 powerpc updates for 5.15 2021-09-03 11:22:50 -07:00
pseries powerpc/64s: Fix VAS mm use after free 2023-07-23 13:47:12 +02:00
Kconfig powerpc/64s: Make prom_init require RELOCATABLE 2021-06-25 14:47:19 +10:00
Kconfig.cputype powerpc/32: Don't always pass -mcpu=powerpc to the compiler 2022-08-25 11:40:43 +02:00
Makefile powerpc: Add Microwatt platform 2021-06-21 21:15:26 +10:00
fsl_uli1575.c