From 0562337b7aaee1c50fa840e220eba4f7478a9e82 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 5 Jul 2026 18:07:42 +0200 Subject: lib: Clean up on cancelled blocking read Cancelling a thread that was blocked in ssm_rbuff_read_b/write_b didn't clean up the n_users reference. If it was in flow_rx_one it didn't unlock the process lock. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/dev.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/lib/dev.c') diff --git a/src/lib/dev.c b/src/lib/dev.c index d0997273..c4c874cc 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -615,7 +615,12 @@ static int flow_rx_one(struct flow * flow, continue; } + pthread_cleanup_push(__cleanup_rwlock_unlock, &proc.lock); + idx = ssm_rbuff_read_b(rx_rb, &wait_abs); + + pthread_cleanup_pop(false); + if (idx == -ETIMEDOUT) { pthread_rwlock_unlock(&proc.lock); if (deadline_passed(abs)) -- cgit v1.2.3