error = ENOBUFS; goto out;
return (ENOBUFS);
lge_alloc_jumbo_mem(struct lge_softc *sc){	caddr_t			ptr, kva;	bus_dma_segment_t	seg;	bus_dmamap_t		dmamap;	int			i, rseg, state, error;	struct lge_jpool_entry   *entry;	state = error = 0;	/* Grab a big chunk o' storage. */	if (bus_dmamem_alloc(sc->sc_dmatag, LGE_JMEM, PAGE_SIZE, 0,			     &seg, 1, &rseg, BUS_DMA_NOWAIT)) {		printf("%s: can't alloc rx buffers\n", sc->sc_dv.dv_xname);		error = ENOBUFS;		goto out;	}	state = 1;	if (bus_dmamem_map(sc->sc_dmatag, &seg, rseg, LGE_JMEM, &kva,			   BUS_DMA_NOWAIT)) {		printf("%s: can't map dma buffers (%d bytes)\n",		       sc->sc_dv.dv_xname, LGE_JMEM);		error = ENOBUFS;		goto out;	}	state = 2;	if (bus_dmamap_create(sc->sc_dmatag, LGE_JMEM, 1,			      LGE_JMEM, 0, BUS_DMA_NOWAIT, &dmamap)) {		printf("%s: can't create dma map\n", sc->sc_dv.dv_xname);		error = ENOBUFS;		goto out;	}	state = 3;	if (bus_dmamap_load(sc->sc_dmatag, dmamap, kva, LGE_JMEM,			    NULL, BUS_DMA_NOWAIT)) {		printf("%s: can't load dma map\n", sc->sc_dv.dv_xname);		error = ENOBUFS;		goto out;        }	state = 4;	sc->lge_cdata.lge_jumbo_buf = (caddr_t)kva;	DPRINTFN(1,("lge_jumbo_buf = 0x%08X\n", sc->lge_cdata.lge_jumbo_buf));	DPRINTFN(1,("LGE_JLEN = 0x%08X\n", LGE_JLEN));	LIST_INIT(&sc->lge_jfree_listhead);	LIST_INIT(&sc->lge_jinuse_listhead);	/*	 * Now divide it up into 9K pieces and save the addresses	 * in an array.	 */	ptr = sc->lge_cdata.lge_jumbo_buf;	for (i = 0; i < LGE_JSLOTS; i++) {		sc->lge_cdata.lge_jslots[i] = ptr;		ptr += LGE_JLEN;		entry = malloc(sizeof(struct lge_jpool_entry), 		    M_DEVBUF, M_NOWAIT);		if (entry == NULL) {			sc->lge_cdata.lge_jumbo_buf = NULL;			printf("%s: no memory for jumbo buffer queue!\n",			       sc->sc_dv.dv_xname);			error = ENOBUFS;			goto out;		}		entry->slot = i;		LIST_INSERT_HEAD(&sc->lge_jfree_listhead,				 entry, jpool_entries);	}out:	if (error != 0) {		switch (state) {		case 4:			bus_dmamap_unload(sc->sc_dmatag, dmamap);		case 3:			bus_dmamap_destroy(sc->sc_dmatag, dmamap);		case 2:			bus_dmamem_unmap(sc->sc_dmatag, kva, LGE_JMEM);		case 1:			bus_dmamem_free(sc->sc_dmatag, &seg, rseg);			break;		default:			break;		}	}	return (error);}