summaryrefslogtreecommitdiffstats
path: root/drivers/net/fddi
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
parentb0b33b048dcfbd7da82c3cde4fab02751dfab4d6 (diff)
downloadlinux-deb7178eb940e2c5caca1b1db084a69b2e59b4c9.tar.bz2
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')
-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;
}