diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-09-06 19:56:05 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-09-06 19:56:05 +0000 |
commit | 353612671a1cd1b8ad6ecd26d38c21af18ba17c3 (patch) | |
tree | ed1bab705cd966490ad4952a924c6245f2d4df8d /xpp | |
parent | fb4e946d994ea5f2a3d1e5f4284668b220013bd9 (diff) |
Fix a possible return from xbus_core without releasing xbus->in_use .
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1414 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp')
-rw-r--r-- | xpp/xbus-core.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xpp/xbus-core.c b/xpp/xbus-core.c index f7b0a70..b346bd7 100644 --- a/xpp/xbus-core.c +++ b/xpp/xbus-core.c @@ -310,7 +310,7 @@ out: 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 @@ static int xbus_poll(void *data) 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 @@ static int xbus_poll(void *data) 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 @@ static int xbus_poll(void *data) card_detected(card_desc); } complete_all(&xbus->xpds_initialized); +out: up_read(&xbus->in_use); - return 0; + return ret; } |