linux/drivers/net/wan
Ruoyu Wang 91957b89da wan: wanxl: Only reset hardware after BAR mapping
wanxl_pci_init_one() stores the freshly allocated card in driver data
before the PLX BAR is mapped.  Several early probe failures then unwind
through wanxl_pci_remove_one(), including failure to allocate the coherent
status area or to restore the DMA mask.

wanxl_pci_remove_one() unconditionally calls wanxl_reset(), and
wanxl_reset() dereferences card->plx.  On those early failures card->plx
is still NULL, so the error path can dereference a NULL MMIO pointer.

Only issue the hardware reset once the BAR mapping exists.  The remaining
cleanup in wanxl_pci_remove_one() already checks whether later resources
were allocated.

This issue was found by a static analysis checker and confirmed by
manual source review.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Link: https://patch.msgid.link/20260708143415.3169358-1-ruoyuw560@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-07-21 13:12:43 +02:00
..
framer Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
.gitignore
c101.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
farsync.c net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
farsync.h
fsl_qmc_hdlc.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
fsl_ucc_hdlc.c net: wan: fsl_ucc_hdlc: free tx_skbuff in uhdlc_memclean 2026-05-08 18:48:30 -07:00
fsl_ucc_hdlc.h
hd64570.c
hd64570.h
hd64572.c
hd64572.h
hdlc_cisco.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
hdlc_fr.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
hdlc_ppp.c hdlc_ppp: sync per-proto timers before freeing hdlc state 2026-06-22 18:19:30 -07:00
hdlc_raw_eth.c
hdlc_raw.c
hdlc_x25.c
hdlc.c
ixp4xx_hss.c net: ixp4xx_hss: fix duplicate HDLC netdev allocation 2026-06-24 17:45:20 -07:00
Kconfig
lapbether.c net: lapbether: handle NETDEV_PRE_TYPE_CHANGE 2026-04-03 14:40:36 -07:00
Makefile
n2.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pc300too.c net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
pci200syn.c net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
slic_ds26522.c
slic_ds26522.h
wanxl.c wan: wanxl: Only reset hardware after BAR mapping 2026-07-21 13:12:43 +02:00
wanxl.h
wanxlfw.inc_shipped
wanxlfw.S