mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Move lock earlier in the call sequence
fctx->state should be read with the lock held.
1559 /*
1560 * Caller must be holding the fctx lock.
1561 */
CID 468796: (#1 of 1): Data race condition (MISSING_LOCK)
1. missing_lock: Accessing fctx->state without holding lock fetchctx.lock.
Elsewhere, fetchctx.state is written to with fetchctx.lock held 2 out of 2 times.
1562 REQUIRE(fctx->state == fetchstate_done);
1563
1564 FCTXTRACE("sendevents");
1565
1566 LOCK(&fctx->lock);
1567
(cherry picked from commit 43f0b0e8eb)
This commit is contained in:
parent
e81e4d0b99
commit
a39b4552a9
1 changed files with 2 additions and 5 deletions
|
|
@ -1562,15 +1562,12 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result) {
|
|||
unsigned int new_spillat = 0; /* initialized to silence
|
||||
* compiler warnings */
|
||||
|
||||
/*
|
||||
* Caller must be holding the fctx lock.
|
||||
*/
|
||||
LOCK(&fctx->lock);
|
||||
|
||||
REQUIRE(fctx->state == fetchstate_done);
|
||||
|
||||
FCTXTRACE("sendevents");
|
||||
|
||||
LOCK(&fctx->lock);
|
||||
|
||||
/*
|
||||
* Keep some record of fetch result for logging later (if required).
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue