[PATCH v3 4/4] xfree86/dri2: Use single error path in initialization

Pauli Nieminen ext-pauli.nieminen at nokia.com
Wed Apr 21 01:40:38 PDT 2010


Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
---
 hw/xfree86/dri2/dri2.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index e60b3a4..255c112 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -864,18 +864,14 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
 	/* Driver too old: use the old-style driverName field */
 	ds->numDrivers = 1;
 	ds->driverNames = xalloc(sizeof(*ds->driverNames));
-	if (!ds->driverNames) {
-	    xfree(ds);
-	    return FALSE;
-	}
+	if (!ds->driverNames)
+	    goto err_out;
 	ds->driverNames[0] = info->driverName;
     } else {
 	ds->numDrivers = info->numDrivers;
 	ds->driverNames = xalloc(info->numDrivers * sizeof(*ds->driverNames));
-	if (!ds->driverNames) {
-	    xfree(ds);
-	    return FALSE;
-	}
+	if (!ds->driverNames)
+		goto err_out;
 	memcpy(ds->driverNames, info->driverNames,
 	       info->numDrivers * sizeof(*ds->driverNames));
     }
-- 
1.6.3.3



More information about the xorg-devel mailing list