From patchwork Thu Jan 22 15:44:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 43521 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 522B3240DB for ; Thu, 22 Jan 2015 15:45:10 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id f15sf1489721lbj.2 for ; Thu, 22 Jan 2015 07:45:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=ieMHk0zA76it33GYr0Gkic7SBh/LTRH2H0rBRrW2R0A=; b=Nk9qT/+z9xy+KOY1IcxeFpI7dqI3hm5jeu1W1gyHPb3MI2J5t6feVj+8dPGWmauB3f aach2M3BvuKXOFiOR0uFHb2lPS0+gEzysucMHJu/JW0AOj9guElVGBb0h0PIifb1QYOF LmeCttR+5Wzuk3PK8XGwElkEj/5V4CJ0QRCP+okj9azFLHssyYM29/xxKEZtIu0stZhJ FDt+emANXK7fcvTtqbjfS3UeuGjxq1SzMYwdTdnFmir3oAcS+vjR/Kgcb02UA3ZFNm22 Z2CpooBZx/IeLCd0NksZMe11c8NV5h43AFtpMzwnFy5eFZNYuyunIw3vBCi6WoQ1k7Gs 01ng== X-Gm-Message-State: ALoCoQllVdS7T8Oe/jWG2pz5WQ2lEY1Ev/NoALlvwx5tN6Gdq1naOx6Ps95mqkDl+efplitdwZsn X-Received: by 10.194.204.201 with SMTP id la9mr57706wjc.6.1421941509280; Thu, 22 Jan 2015 07:45:09 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.242.129 with SMTP id wq1ls162401lac.56.gmail; Thu, 22 Jan 2015 07:45:09 -0800 (PST) X-Received: by 10.112.156.132 with SMTP id we4mr2334891lbb.59.1421941509122; Thu, 22 Jan 2015 07:45:09 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id zl8si21081943lbb.27.2015.01.22.07.45.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 07:45:09 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id w7so2258334lbi.1 for ; Thu, 22 Jan 2015 07:45:09 -0800 (PST) X-Received: by 10.112.125.41 with SMTP id mn9mr2406211lbb.80.1421941508824; Thu, 22 Jan 2015 07:45:08 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp303954lbb; Thu, 22 Jan 2015 07:45:07 -0800 (PST) X-Received: by 10.224.156.75 with SMTP id v11mr3785846qaw.58.1421941506774; Thu, 22 Jan 2015 07:45:06 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id m8si9305200qat.62.2015.01.22.07.45.05 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 22 Jan 2015 07:45:06 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YEJwN-0007dn-Oh; Thu, 22 Jan 2015 15:45:03 +0000 Received: from mail-la0-f51.google.com ([209.85.215.51]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YEJwH-0007cX-TG for lng-odp@lists.linaro.org; Thu, 22 Jan 2015 15:44:58 +0000 Received: by mail-la0-f51.google.com with SMTP id ge10so2315270lab.10 for ; Thu, 22 Jan 2015 07:44:52 -0800 (PST) X-Received: by 10.152.27.228 with SMTP id w4mr2333476lag.75.1421941491969; Thu, 22 Jan 2015 07:44:51 -0800 (PST) Received: from localhost.localdomain (broadband-46-188-125-104.2com.net. [46.188.125.104]) by mx.google.com with ESMTPSA id is5sm6405308lac.41.2015.01.22.07.44.50 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 Jan 2015 07:44:50 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 22 Jan 2015 18:44:43 +0300 Message-Id: <1421941485-13742-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 X-Topics: patch Subject: [lng-odp] [PATCHv2 1/3] linux-generic: shm: odp_shm_free bug fix X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Petri Savolainen Free should use the original address from mmap() and not the align adjusted address. Signed-off-by: Petri Savolainen Signed-off-by: Maxim Uvarov --- platform/linux-generic/odp_shared_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index 99c5b40..7d54f09 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -135,7 +135,7 @@ int odp_shm_free(odp_shm_t shm) shm_block = &odp_shm_tbl->block[i]; alloc_size = shm_block->size + shm_block->align; - ret = munmap(shm_block->addr, alloc_size); + ret = munmap(shm_block->addr_orig, alloc_size); if (0 != ret) { ODP_DBG("odp_shm_free: munmap failed\n"); odp_spinlock_unlock(&odp_shm_tbl->lock);