2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Move lock to before label to prevent duplicate lock

*** CID 351370:  Program hangs  (LOCK)
    /lib/dns/adb.c: 2699 in dns_adb_cancelfind()
    2693
    2694     	LOCK(&nbucket->lock);
    2695     	ISC_LIST_UNLINK(adbname->finds, find, plink);
    2696     	UNLOCK(&nbucket->lock);
    2697
    2698     cleanup:
    >>>     CID 351370:  Program hangs  (LOCK)
    >>>     "pthread_mutex_lock" locks "find->lock" while it is locked.
    2699     	LOCK(&find->lock);
    2700     	if (!FIND_EVENTSENT(find)) {
    2701     		ev = &find->event;
    2702     		task = ev->ev_sender;
    2703     		ev->ev_sender = find;
    2704     		ev->ev_type = DNS_EVENT_ADBCANCELED;
This commit is contained in:
Mark Andrews
2022-04-06 12:56:17 +10:00
parent 05e08a21d1
commit ed1e480c53

View File

@@ -2687,14 +2687,14 @@ dns_adb_cancelfind(dns_adbfind_t *find) {
adbname = find->adbname;
find->adbname = NULL;
nbucket = adbname->bucket;
UNLOCK(&find->lock);
UNLOCK(&find->lock);
LOCK(&nbucket->lock);
ISC_LIST_UNLINK(adbname->finds, find, plink);
UNLOCK(&nbucket->lock);
LOCK(&find->lock);
cleanup:
LOCK(&find->lock);
if (!FIND_EVENTSENT(find)) {
ev = &find->event;
task = ev->ev_sender;