[zaptel-commits] tzafrir: trunk r1414 - /trunk/xpp/xbus-core.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Wed Sep 6 12:56:06 MST 2006


Author: tzafrir
Date: Wed Sep  6 14:56:05 2006
New Revision: 1414

URL: http://svn.digium.com/view/zaptel?rev=1414&view=rev
Log:
Fix a possible return from xbus_core without releasing xbus->in_use .

Modified:
    trunk/xpp/xbus-core.c

Modified: trunk/xpp/xbus-core.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/xbus-core.c?rev=1414&r1=1413&r2=1414&view=diff
==============================================================================
--- trunk/xpp/xbus-core.c (original)
+++ trunk/xpp/xbus-core.c Wed Sep  6 14:56:05 2006
@@ -310,7 +310,7 @@
 static int xbus_poll(void *data)
 {
 	int			id;
-	int			ret;
+	int			ret = 0;
 	unsigned long		flags;
 	struct list_head	*card;
 	struct list_head	*next_card;
@@ -340,8 +340,8 @@
 		ret = CALL_PROTO(GLOBAL, DESC_REQ, xbus, NULL, id);
 		spin_lock_irqsave(&xbus->lock, flags);
 		if(ret < 0) {
-			NOTICE("xpp: %s: Failed sending DESC_REQ to XPD #%d\n", __FUNCTION__, id);
-			break;
+			ERR("xpp: %s: Failed sending DESC_REQ to XPD #%d\n", __FUNCTION__, id);
+			goto out;
 		}
 		mdelay(1);	/* FIXME: debugging for Dima */
 	}
@@ -353,7 +353,7 @@
 	ret = wait_event_timeout(xbus->wait_for_polls, atomic_read(&xbus->count_poll_answers) >= MAX_XPDS, POLL_TIMEOUT);
 	if(ret < 0) {
 		ERR("%s: Poll timeout %d\n", xbus->busname, ret);
-		return ret;
+		goto out;
 	}
 	DBG("%s: Poll finished. Start processing.\n", xbus->busname);
 	/*
@@ -410,8 +410,9 @@
 		card_detected(card_desc);
 	}
 	complete_all(&xbus->xpds_initialized);
+out:
 	up_read(&xbus->in_use);
-	return 0;
+	return ret;
 }
 
 



More information about the zaptel-commits mailing list