aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fddi/defza.c
diff options
context:
space:
mode:
authorPavel Skripkin <paskripkin@gmail.com>2021-07-13 13:58:53 +0300
committerDavid S. Miller <davem@davemloft.net>2021-07-13 09:43:50 -0700
commitdeb7178eb940e2c5caca1b1db084a69b2e59b4c9 (patch)
tree5a2b59f4ba08ff0488b0088e3be2851ee7cc066f /drivers/net/fddi/defza.c
parentnet: dsa: sja1105: fix address learning getting disabled on the CPU port (diff)
downloadlinux-dev-deb7178eb940e2c5caca1b1db084a69b2e59b4c9.tar.xz
linux-dev-deb7178eb940e2c5caca1b1db084a69b2e59b4c9.zip
net: fddi: fix UAF in fza_probe
fp is netdev private data and it cannot be used after free_netdev() call. Using fp after free_netdev() can cause UAF bug. Fix it by moving free_netdev() after error message. Fixes: 61414f5ec983 ("FDDI: defza: Add support for DEC FDDIcontroller 700 TURBOchannel adapter") Signed-off-by: Pavel Skripkin <paskripkin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fddi/defza.c')
-rw-r--r--drivers/net/fddi/defza.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/fddi/defza.c b/drivers/net/fddi/defza.c
index 14f07050b6b1..0de2c4552f5e 100644
--- a/drivers/net/fddi/defza.c
+++ b/drivers/net/fddi/defza.c
@@ -1504,9 +1504,8 @@ err_out_resource:
release_mem_region(start, len);
err_out_kfree:
- free_netdev(dev);
-
pr_err("%s: initialization failure, aborting!\n", fp->name);
+ free_netdev(dev);
return ret;
}