rem: ed = malloc(sizeof(struct ether_device));
add: ed = (struct ether_device*) malloc(sizeof(struct ether_device));
context: static void attach_device(int devid, char *driver, char *devno){	struct ether_device *ed;	struct ifnet *ifp;	struct ifaddr *ifa;	struct sockaddr_dl *sdl;	status_t status;	int fsz = 0;			ed = malloc(sizeof(struct ether_device));	if (!ed)		return;		memset(ed, 0, sizeof(*ed));	ifp = &ed->sc_if;		/* get the MAC address... */	status = ioctl(devid, IF_GETADDR, &ed->sc_addr, 6);	if (status < B_OK) {		printf("%s/%s: ignored: Failed to get a MAC address\n", driver, devno);		close(devid);		free(ed);		return;	}	/* Try to detrmine the MTU to use */	status = ioctl(devid, IF_GETFRAMESIZE, &fsz, sizeof(fsz));	if (status < 0) {		printf("%s/%s: IF_GETFRAMESIZE not supported, defaulting to %d\n",		       driver, devno, ETHERMTU);		ifp->if_mtu = ETHERMTU;	} else		ifp->if_mtu = fsz;			ifp->devid = -1;	ifp->if_type = IFT_ETHER;	ifp->name = strdup(driver);	ifp->if_unit = atoi(devno);	ifp->if_hdrlen = 14;	ifp->if_addrlen = 6;	ifp->if_flags |= (IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST);		ifp->rx_thread = -1;	ifp->tx_thread = -1;	ifp->devq = etherq;		ifp->input = NULL;//&ether_input;	ifp->output = &ether_output;	ifp->stop = &ether_dev_stop;	ifp->ioctl = &ether_ioctl;		if_attach(ifp);	/* Add the MAC address to our list of addresses... */	for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) {		if ((sdl = (struct sockaddr_dl*)ifa->ifa_addr) &&		    sdl->sdl_family == AF_LINK) {			sdl->sdl_type = IFT_ETHER;			sdl->sdl_alen = ifp->if_addrlen;			memcpy(LLADDR(sdl), &ed->sc_addr, ifp->if_addrlen);			break;		}	}		ed->next = NULL; /* we get added at the end of the list */	/* we maintain our own list of devices as well as the global list */	if (!ether_devices) {		ether_devices = ed;	} else {		struct ether_device *dptr = ether_devices;		while (dptr->next)			dptr = dptr->next;		dptr->next = ed;	}}