You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[netdrvr] Fix register_netdev() races in older ISA net drivers
This commit is contained in:
+8
-11
@@ -180,12 +180,7 @@ struct net_device * __init ne_probe(int unit)
|
||||
err = do_ne_probe(dev);
|
||||
if (err)
|
||||
goto out;
|
||||
err = register_netdev(dev);
|
||||
if (err)
|
||||
goto out1;
|
||||
return dev;
|
||||
out1:
|
||||
cleanup_card(dev);
|
||||
out:
|
||||
free_netdev(dev);
|
||||
return ERR_PTR(err);
|
||||
@@ -325,8 +320,13 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
|
||||
dev->poll_controller = ei_poll;
|
||||
#endif
|
||||
NS8390_init(dev, 0);
|
||||
return 0;
|
||||
|
||||
ret = register_netdev(dev);
|
||||
if (ret)
|
||||
goto out_irq;
|
||||
return 0;
|
||||
out_irq:
|
||||
free_irq(dev->irq, dev);
|
||||
err_out:
|
||||
release_region(ioaddr, NE_IO_EXTENT);
|
||||
return ret;
|
||||
@@ -633,11 +633,8 @@ int init_module(void)
|
||||
err = init_reg_offset(dev, dev->base_addr);
|
||||
if (!err) {
|
||||
if (do_ne_probe(dev) == 0) {
|
||||
if (register_netdev(dev) == 0) {
|
||||
dev_ne[found++] = dev;
|
||||
continue;
|
||||
}
|
||||
cleanup_card(dev);
|
||||
dev_ne[found++] = dev;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
free_netdev(dev);
|
||||
|
||||
Reference in New Issue
Block a user