linux/drivers/net/wan
Haoxiang Li db818b0e8a net: ixp4xx_hss: fix duplicate HDLC netdev allocation
ixp4xx_hss_probe() allocates two HDLC netdevs. The first one is stored
in ndev, initialized, and registered with register_hdlc_device(). The
second one is stored in port->netdev and later used by the remove path
for unregister_hdlc_device() and free_netdev().

This means that the registered netdev is not the same object that is
unregistered and freed on remove. It also leaks the first allocation if
the second alloc_hdlcdev() call fails, and the first allocation is not
checked before ndev is used.

Older code allocated the HDLC netdev only once and stored the same object
in both the local variable and port->netdev. The buggy conversion split
this into two alloc_hdlcdev() calls. A later rename changed the local
variable name to ndev, but the underlying mismatch remained.

Fix this by allocating the HDLC netdev only once and assigning the same
object to port->netdev.

Fixes: 99ebe65eb9 ("net: ixp4xx_hss: move out assignment in if condition")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260622043015.643637-1-haoxiang_li2024@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-06-24 17:45:20 -07: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 WAN: Fix syntax errors in comments 2022-06-07 10:45:25 +02:00
fsl_qmc_hdlc.c net: Switch back to struct platform_driver::remove() 2024-10-04 16:39:57 -07: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 net: hd64570: add some required spaces 2021-06-07 12:25:21 -07:00
hd64570.h
hd64572.c net: wan: switch to netif_napi_add_weight() 2022-05-08 11:33:57 +01:00
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 net: split out ndo_siowandev ioctl 2021-07-27 20:11:45 +01:00
hdlc_raw.c net: split out ndo_siowandev ioctl 2021-07-27 20:11:45 +01:00
hdlc_x25.c net: split out ndo_siowandev ioctl 2021-07-27 20:11:45 +01:00
hdlc.c net: split out ndo_siowandev ioctl 2021-07-27 20:11:45 +01:00
ixp4xx_hss.c net: ixp4xx_hss: fix duplicate HDLC netdev allocation 2026-06-24 17:45:20 -07:00
Kconfig net: handle HAS_IOPORT dependencies 2024-04-08 11:56:56 +01:00
lapbether.c net: lapbether: handle NETDEV_PRE_TYPE_CHANGE 2026-04-03 14:40:36 -07:00
Makefile net: wan: Add support for QMC HDLC 2024-03-11 09:36:11 +00:00
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 net: fill in MODULE_DESCRIPTION()s for ds26522 module 2024-01-11 16:16:08 -08:00
slic_ds26522.h
wanxl.c net: Consistently define pci_device_ids using named initializers 2026-05-12 18:16:34 -07:00
wanxl.h
wanxlfw.inc_shipped
wanxlfw.S