From 5f1e4ae331f12dd38e46641b8506c7170b019bf6 Mon Sep 17 00:00:00 2001 From: Kip Macy Date: Fri, 20 Apr 2007 05:16:42 +0000 Subject: [PATCH] Free cluster if we fail to create the dmamap. Fixes CID 1829 Found by: Coverity --- sys/dev/cxgb/cxgb_sge.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index d95c4ca18c79..db54ec2583ee 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -481,9 +481,7 @@ refill_fl(adapter_t *sc, struct sge_fl *q, int n) if ((sd->flags & RX_SW_DESC_MAP_CREATED) == 0) { if ((err = bus_dmamap_create(q->entry_tag, 0, &sd->map))) { log(LOG_WARNING, "bus_dmamap_create failed %d\n", err); - /* - * XXX free cluster - */ + uma_zfree(q->zone, cl); goto done; } sd->flags |= RX_SW_DESC_MAP_CREATED;