OpenCloudOS-Kernel/drivers/ssb
Rand Deeb c5dc2d8eb3 ssb: Fix potential NULL pointer dereference in ssb_device_uevent()
[ Upstream commit 789c17185fb0f39560496c2beab9b57ce1d0cbe7 ]

The ssb_device_uevent() function first attempts to convert the 'dev' pointer
to 'struct ssb_device *'. However, it mistakenly dereferences 'dev' before
performing the NULL check, potentially leading to a NULL pointer
dereference if 'dev' is NULL.

To fix this issue, move the NULL check before dereferencing the 'dev' pointer,
ensuring that the pointer is valid before attempting to use it.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Rand Deeb <rand.sec96@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240306123028.164155-1-rand.sec96@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-27 13:49:01 +02:00
..
Kconfig
Makefile
b43_pci_bridge.c
bridge_pcmcia_80211.c
driver_chipcommon.c
driver_chipcommon_pmu.c
driver_chipcommon_sflash.c
driver_extif.c
driver_gige.c
driver_gpio.c ssb: gpio: Use generic_handle_irq_safe() 2022-09-19 15:08:38 +02:00
driver_mipscore.c
driver_pcicore.c
embedded.c
host_soc.c
main.c ssb: Fix potential NULL pointer dereference in ssb_device_uevent() 2024-06-27 13:49:01 +02:00
pci.c ssb: remove unreachable code 2022-05-11 08:29:11 +03:00
pcihost_wrapper.c ssb: Use dev_driver_string() instead of pci_dev->driver->name 2021-10-12 17:50:12 -05:00
pcmcia.c ssb: use DEVICE_ATTR_ADMIN_RW() helper macro 2021-06-15 13:11:56 +03:00
scan.c ssb: Fix error return code in ssb_bus_scan() 2021-06-15 13:10:42 +03:00
sdio.c ssb: sdio: Don't overwrite const buffer if block_write fails 2021-06-15 13:10:59 +03:00
sprom.c
ssb_private.h