From patchwork Thu Nov 5 18:02:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 56070 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp552568lbr; Thu, 5 Nov 2015 10:02:38 -0800 (PST) X-Received: by 10.55.79.68 with SMTP id d65mr8941149qkb.35.1446746558718; Thu, 05 Nov 2015 10:02:38 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c68si5410361qgf.124.2015.11.05.10.02.38; Thu, 05 Nov 2015 10:02:38 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id F347861CE0; Thu, 5 Nov 2015 18:02:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 05B8061B30; Thu, 5 Nov 2015 18:02:33 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 057C961B63; Thu, 5 Nov 2015 18:02:17 +0000 (UTC) Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) by lists.linaro.org (Postfix) with ESMTPS id 1D8B661B2D for ; Thu, 5 Nov 2015 18:02:15 +0000 (UTC) Received: by obdgf3 with SMTP id gf3so72400442obd.3 for ; Thu, 05 Nov 2015 10:02:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=fu8xrbFqvz0e/JiB107B/VzctO6U+IjevkzmbjUrPL8=; b=rTPgi4V3X1EWEAxZYvMWH2h6OIK4EDevPYjzszZauvjJLt2IgsV4YVhRge5o2LHRYz t4oRYPqz4GpceR42tSXl3MJgYx4U7vQMdt5Dpeg4fLjdgYAYfzty0dSqmd4sj07tLb4n zNzNig+2I+cT8L81ler7QOvGATyCTIY/0ql1lnrnfxuMoyjb1zPy4MGhFzs8QESYSbKE MVQok3155/S/Q0dshOKjqDYQS6cfkp3aidnCtwb+8lMRwheI25nToQS2wB/2PMu4HZd5 n5stpFw3rOh6owExGt3o1jVql0GDbdoGl0299u0D5EUzW+Hl1jjkaQJFv7TDyBqfaUk2 7zdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fu8xrbFqvz0e/JiB107B/VzctO6U+IjevkzmbjUrPL8=; b=B0QpS+H3Y3YrsPwxeGrvyfYOrBp/Vksy9+1yBKO/Hm9+D/11v53sAXBL5KKQ2xT4Rh gyh+nEl/4twNs/Fvcw6OjvlygETIgGnnhEM5DRAx60wi4ahz7TqaB7vyUkGzXCJ6dO2Z 8efQ+dWflA5Dq3oTwiBicfHd0kzEX0ONqXxicrPKkr8LjXNBz32Wym64dQqm8kj6QzD1 j7ec+Or6xTWc2eiLdy0f9h79DAGQhxgxchPoZtUWK8BScYVuJ6r0XvAzjXXYxDJ9txGe kHoXiSuCqudErPtyI771qrCGBREJDRgc7dOc0tbo5yQjRICh+V/FL8g2bdcYDzMR47W0 UauQ== X-Gm-Message-State: ALoCoQlg+ND/eqnWsqQ0BzhwQeeN7p06NuFlsrSe3Vzc6/aZgY+E936C0Dv7eAlFDW9puXWrXfPY X-Received: by 10.60.226.131 with SMTP id rs3mr5417219oec.8.1446746534504; Thu, 05 Nov 2015 10:02:14 -0800 (PST) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id s5sm3072789oie.12.2015.11.05.10.02.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Nov 2015 10:02:13 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 5 Nov 2015 12:02:07 -0600 Message-Id: <1446746528-25786-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 X-Topics: patch Subject: [lng-odp] [PATCH 1/2] linux-generic: pool: catch duplicate free errors in debug builds X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Bill Fischofer Reviewed-by: Balasubramanian Manoharan --- platform/linux-generic/odp_pool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 76a4aa5..9fd64d6 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -540,6 +540,8 @@ void odp_buffer_free(odp_buffer_t buf) odp_buffer_hdr_t *buf_hdr = odp_buf_to_hdr(buf); pool_entry_t *pool = odp_buf_to_pool(buf_hdr); + ODP_ASSERT(buf_hdr->allocator != ODP_FREEBUF); + if (odp_unlikely(pool->s.low_wm_assert)) ret_buf(&pool->s, buf_hdr); else