From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.6 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5743A1F4C4 for ; Sat, 2 Nov 2019 02:03:32 +0000 (UTC) From: Eric Wong To: mwrap-perl@80x24.org Subject: [PATCH 3/7] memalign: perform rcu_read_unlock on ENOMEM Date: Sat, 2 Nov 2019 02:03:27 +0000 Message-Id: <20191102020331.28050-4-e@80x24.org> In-Reply-To: <20191102020331.28050-1-e@80x24.org> References: <20191102020331.28050-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We must not forget to release RCU read locks even if the process will probably die, soon, due to ENOMEM. --- Mwrap.xs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mwrap.xs b/Mwrap.xs index f902468..92fc4de 100644 --- a/Mwrap.xs +++ b/Mwrap.xs @@ -459,9 +459,9 @@ internal_memalign(void **pp, size_t alignment, size_t size, uintptr_t caller) p = ptr_align(p, alignment); h = ptr2hdr(p); alloc_insert_rcu(l, h, size, real); - update_stats_rcu_unlock(l); *pp = p; } + update_stats_rcu_unlock(l); return real ? 0 : ENOMEM; }