From: Tim Duesterhus Date: Mon, 28 Feb 2022 18:16:31 +0000 (+0100) Subject: MINOR: queue: Replace if() + abort() with BUG_ON() X-Git-Tag: v2.6-dev3~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc8348fbc14cbf9c696fc448fdc681e48ce1f751;p=thirdparty%2Fhaproxy.git MINOR: queue: Replace if() + abort() with BUG_ON() see 5cd4bbd7a ("BUG/MAJOR: threads/queue: Fix thread-safety issues on the queues management") --- diff --git a/src/queue.c b/src/queue.c index b1be766b9e..002b94b85d 100644 --- a/src/queue.c +++ b/src/queue.c @@ -567,14 +567,13 @@ int pendconn_dequeue(struct stream *strm) struct pendconn *p; int is_unlinked; - if (unlikely(!strm->pend_pos)) { - /* unexpected case because it is called by the stream itself and - * only the stream can release a pendconn. So it is only - * possible if a pendconn is released by someone else or if the - * stream is supposed to be queued but without its associated - * pendconn. In both cases it is a bug! */ - abort(); - } + /* unexpected case because it is called by the stream itself and + * only the stream can release a pendconn. So it is only + * possible if a pendconn is released by someone else or if the + * stream is supposed to be queued but without its associated + * pendconn. In both cases it is a bug! */ + BUG_ON(!strm->pend_pos); + p = strm->pend_pos; /* note below : we need to grab the queue's lock to check for emptiness