linux-stable/drivers
Sergei Antonov 246bbf2f97 net: dsa: mv88e6060: prevent crash on an unused port
If the port isn't a CPU port nor a user port, 'cpu_dp'
is a null pointer and a crash happened on dereferencing
it in mv88e6060_setup_port():

[    9.575872] Unable to handle kernel NULL pointer dereference at virtual address 00000014
...
[    9.942216]  mv88e6060_setup from dsa_register_switch+0x814/0xe84
[    9.948616]  dsa_register_switch from mdio_probe+0x2c/0x54
[    9.954433]  mdio_probe from really_probe.part.0+0x98/0x2a0
[    9.960375]  really_probe.part.0 from driver_probe_device+0x30/0x10c
[    9.967029]  driver_probe_device from __device_attach_driver+0xb8/0x13c
[    9.973946]  __device_attach_driver from bus_for_each_drv+0x90/0xe0
[    9.980509]  bus_for_each_drv from __device_attach+0x110/0x184
[    9.986632]  __device_attach from bus_probe_device+0x8c/0x94
[    9.992577]  bus_probe_device from deferred_probe_work_func+0x78/0xa8
[    9.999311]  deferred_probe_work_func from process_one_work+0x290/0x73c
[   10.006292]  process_one_work from worker_thread+0x30/0x4b8
[   10.012155]  worker_thread from kthread+0xd4/0x10c
[   10.017238]  kthread from ret_from_fork+0x14/0x3c

Fixes: 0abfd494de ("net: dsa: use dedicated CPU port")
CC: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
CC: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Sergei Antonov <saproj@gmail.com>
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20220811070939.1717146-1-saproj@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-08-12 17:24:44 -07:00
..
accessibility TTY / Serial driver changes for 6.0-rc1 2022-08-08 11:31:40 -07:00
acpi More ACPI updates for 5.20-rc1 2022-08-11 13:26:09 -07:00
amba
android - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
ata powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
atm atm: idt77252: fix use-after-free bugs caused by tst_timer 2022-08-08 20:51:59 -07:00
auxdisplay
base Driver core / kernfs changes for 6.0-rc1 2022-08-04 11:31:20 -07:00
bcma
block We have a good pile of various fixes and cleanups from Xiubo, Jeff, 2022-08-11 12:41:07 -07:00
bluetooth SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
bus SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
cdrom
char s390 updates for 5.20 merge window 2022-08-06 17:05:21 -07:00
clk The clk core gains a new set of APIs that allow drivers to both acquire clks 2022-08-04 18:40:08 -07:00
clocksource RISC-V Patches for the 5.20 Merge Window, Part 1 2022-08-06 15:04:48 -07:00
comedi pci-v5.20-changes 2022-08-04 19:30:35 -07:00
connector
counter
cpufreq More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
cpuidle More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
crypto This update includes the following changes: 2022-08-02 17:45:14 -07:00
cxl cxl/hdm: Fix skip allocations vs multiple pmem allocations 2022-08-05 16:11:38 -07:00
dax
dca
devfreq More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
dio
dma pci-v5.20-changes 2022-08-04 19:30:35 -07:00
dma-buf drm for 5.20/6.0 2022-08-03 19:52:08 -07:00
edac powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
eisa
extcon
firewire
firmware RISC-V Patches for the 5.20 Merge Window, Part 1 2022-08-06 15:04:48 -07:00
fpga
fsi
gnss
gpio gpio: updates for v6.0-rc1 2022-08-04 18:34:05 -07:00
gpu More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
greybus
hid platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
hsi
hte
hv
hwmon hwmon: (nct6775) Fix platform driver suspend regression 2022-08-10 06:37:01 -07:00
hwspinlock
hwtracing asm-generic: updates for 6.0 2022-08-05 10:07:23 -07:00
i2c powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
i3c
idle Power management updates for 5.20-rc1 2022-08-02 11:17:00 -07:00
iio
infiniband dma-mapping updates 2022-08-06 10:56:45 -07:00
input Input updates for 5.20 (6.0) merge window: 2022-08-11 09:23:08 -07:00
interconnect
iommu Bitmap patches for v6.0-rc1 2022-08-07 17:52:35 -07:00
ipack
irqchip RISC-V Patches for the 5.20 Merge Window, Part 1 2022-08-06 15:04:48 -07:00
isdn
leds LED updates for 5.20: new driver for bcm63138, is31fl319x updates, 2022-08-08 11:36:21 -07:00
macintosh
mailbox - mtk: use rx_callback instead of cmdq_task_cb. 2022-08-08 10:19:40 -07:00
mcb
md - Add flags argument to dm_bufio_client_create and introduce 2022-08-06 11:09:55 -07:00
media More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
memory More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
memstick MMC core: 2022-08-04 19:41:09 -07:00
message
mfd - Core Frameworks 2022-08-06 10:25:16 -07:00
misc - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
mmc MMC core: 2022-08-04 19:41:09 -07:00
most
mtd MTD core changes: 2022-08-05 14:13:45 -07:00
mux
net net: dsa: mv88e6060: prevent crash on an unused port 2022-08-12 17:24:44 -07:00
nfc
ntb
nubus
nvdimm cxl for 6.0 2022-08-10 11:07:26 -07:00
nvme dma-mapping updates 2022-08-06 10:56:45 -07:00
nvmem SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
of TTY / Serial driver changes for 6.0-rc1 2022-08-08 11:31:40 -07:00
opp OPP updates for 5.20-rc1 2022-08-03 17:49:38 +02:00
parisc parisc architecture fixes and updates for kernel v5.20-rc1: 2022-08-05 09:58:58 -07:00
parport
pci cxl for 6.0 2022-08-10 11:07:26 -07:00
pcmcia
peci
perf
phy pci-v5.20-changes 2022-08-04 19:30:35 -07:00
pinctrl Pin control bulk changes for v6.0: 2022-08-10 11:01:44 -07:00
platform platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
pnp
power platform-drivers-x86 for v6.0-1 2022-08-04 18:19:14 -07:00
powercap Power management updates for 5.20-rc1 2022-08-02 11:17:00 -07:00
pps
ps3
ptp SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
pwm SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
rapidio
ras
regulator chrome platform changes for 5.20 2022-08-04 18:13:19 -07:00
remoteproc remoteproc: qcom_q6v5_pas: Do not fail if regulators are not found 2022-08-08 10:32:17 -05:00
reset ARM: SoC: late updates for 6.0 2022-08-05 10:02:33 -07:00
rpmsg
rtc
s390 Including fixes from bluetooth, bpf, can and netfilter. 2022-08-11 13:45:37 -07:00
sbus
scsi powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
sh
siox
slimbus
soc More power management updates for 5.20-rc1 2022-08-08 14:29:00 -07:00
soundwire sound updates for 6.0-rc1 2022-08-06 10:19:51 -07:00
spi powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
spmi
ssb
staging Staging driver patches for 6.0-rc1 2022-08-04 12:01:42 -07:00
target SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
tc
tee
thermal More thermal control updates for 5.20-rc1 2022-08-08 14:23:37 -07:00
thunderbolt USB / Thunderbolt changes for 6.0-rc1 2022-08-04 11:41:28 -07:00
tty TTY / Serial driver changes for 6.0-rc1 2022-08-08 11:31:40 -07:00
ufs SCSI misc on 20220804 2022-08-04 19:47:37 -07:00
uio
usb TTY / Serial driver changes for 6.0-rc1 2022-08-08 11:31:40 -07:00
vdpa
vfio VFIO updates for v6.0-rc1 2022-08-06 08:59:35 -07:00
vhost iov_iter: advancing variants of iov_iter_get_pages{,_alloc}() 2022-08-08 22:37:22 -04:00
video TTY / Serial driver changes for 6.0-rc1 2022-08-08 11:31:40 -07:00
virt Char / Misc driver changes for 6.0-rc1 2022-08-04 11:05:48 -07:00
virtio - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
vlynq
w1
watchdog linux-watchdog 5.20-rc1 tag 2022-08-08 15:04:04 -07:00
xen - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
zorro
Kconfig
Makefile Staging driver patches for 6.0-rc1 2022-08-04 12:01:42 -07:00