]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: arcnet: com20020-pci: fix support for 2.5Mbit cards
authorEthan Nelson-Moore <enelsonmoore@gmail.com>
Fri, 13 Feb 2026 04:55:09 +0000 (20:55 -0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 17 Feb 2026 11:14:21 +0000 (12:14 +0100)
commitc7d9be66b71af490446127c6ffcb66d6bb71b8b9
tree040568566285d9ad8cf736eb9ac5647854b36c25
parentda29e453dcb3aa7cabead7915f5f945d0add3a52
net: arcnet: com20020-pci: fix support for 2.5Mbit cards

Commit 8c14f9c70327 ("ARCNET: add com20020 PCI IDs with metadata")
converted the com20020-pci driver to use a card info structure instead
of a single flag mask in driver_data. However, it failed to take into
account that in the original code, driver_data of 0 indicates a card
with no special flags, not a card that should not have any card info
structure. This introduced a null pointer dereference when cards with
no flags were probed.

Commit bd6f1fd5d33d ("net: arcnet: com20020: Fix null-ptr-deref in
com20020pci_probe()") then papered over this issue by rejecting cards
with no driver_data instead of resolving the problem at its source.

Fix the original issue by introducing a new card info structure for
2.5Mbit cards that does not set any flags and using it if no
driver_data is present.

Fixes: 8c14f9c70327 ("ARCNET: add com20020 PCI IDs with metadata")
Fixes: bd6f1fd5d33d ("net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe()")
Cc: stable@vger.kernel.org
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Link: https://patch.msgid.link/20260213045510.32368-1-enelsonmoore@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/arcnet/com20020-pci.c