]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/pc/etherec2t.c
archacpi: make *acpi=1 the default
[plan9front.git] / sys / src / 9 / pc / etherec2t.c
index 4359e399baf93313043cf88df3aa9bd257dd27a2..b22619c227541a35d4ac79220a85bfa813e0b315 100644 (file)
@@ -9,8 +9,8 @@
 #include "io.h"
 #include "../port/error.h"
 #include "../port/netif.h"
+#include "../port/etherif.h"
 
-#include "etherif.h"
 #include "ether8390.h"
 
 enum {
@@ -84,13 +84,13 @@ reset(Ether* ether)
                                ec2t->iochecksum = 1;
                }
        }
-       if(slot < 0){
+       ctlr = malloc(sizeof(Dp8390));
+       if(ctlr == nil || slot < 0){
                iofree(port);
+               free(ctlr);
                return -1;
        }
-
-       ether->ctlr = malloc(sizeof(Dp8390));
-       ctlr = ether->ctlr;
+       ether->ctlr = ctlr;
        ctlr->width = 2;
        ctlr->ram = 0;