From patchwork Sat Jun 10 00:26:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Rowand X-Patchwork-Id: 9779577 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D8D54601EA for ; Sat, 10 Jun 2017 00:27:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA1762864D for ; Sat, 10 Jun 2017 00:27:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE76C28668; Sat, 10 Jun 2017 00:27:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 500602864D for ; Sat, 10 Jun 2017 00:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=yVZjZX5zZXmwUwi5I4uKazXY/S37EjJH2QHS1NwuXK4=; b=Vyp 0lmNu4HRUGx7yzQs01gVDlZ0OLeZFH3wkvsjGAk+fAk1Qqzjto0deZJL3lu6M+tAbD3hr/6zSIUml NhSQVMIaKWHFNU4oDgzTxvnVNwhyQKr45OWy4265eipWE7VbDVQhDI27p5nHd5mh8xKkG6gWut/Cp YP93brPcsUFkiLMm9Fsm3/Z7uh/xrosFDHhT5tsW0M7EqF6hmQ6cUirONMMaOC+VSLgoMYRJnfyZO 5rHWswtIvtsEaELW6Bq3ZEtXqTMZ9qPdAXXV5hqvkcXnpFgdS9T8w5lel2e2aQenTuBfa0u32lWF9 aRqF0K/ZyIEnkrt8jdNBb0MUDtV2Ctw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dJUFq-0001IG-2t; Sat, 10 Jun 2017 00:27:50 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dJUFm-0001FP-QL for linux-arm-kernel@lists.infradead.org; Sat, 10 Jun 2017 00:27:48 +0000 Received: by mail-pf0-x244.google.com with SMTP id u26so10043202pfd.2 for ; Fri, 09 Jun 2017 17:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Tko27YLrdB+13CaBYb06WgP5p/3STJ49JocsgqUyyV8=; b=ut76cNX4GPUdD1BoiGscpoVtav5HhkI2pi1iyHlJk+kSsQhDO6oD7eYzW3QN3wUBdh dohEaUWbpJFEox86jVEJ0z8+9vy4bbbdHMwQjd51beDyhNu/f6sGqmCUuHeAqvFrHKN9 7Rq2yLGPAFpM5LrnzpVCL221UPKNqMwkuZo4/SnzgkOXS/fZOZ9d5mOhdEuRdF6pXc2X m+n0Yq1JwuDVnwvFKIr2mCqyck0qZJeMSA75tzgvc7YKVbd+VIlCkSstpLf9ABkgrN1T mE5qI356qLFzPcKtwQ7cVKNTvpESWZksNR7JK15LCyQDEl30cXIRu3jyHtPn605y5c7+ YK2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Tko27YLrdB+13CaBYb06WgP5p/3STJ49JocsgqUyyV8=; b=uD5qTopi+uG0Aq8MjA1lPmXNezFdifdkYXC8D2GHLzfbveAdD58genLIvZiBYC32TQ scVcd/mLELNhDUxt8NqjNQ0gbMYiYvfJ+Ir+fxhPxfdoHBXR7cTZyFW7FPL2jYj+h/3R BVeHnzKq/087T2tAHw1Uyv5mzjOsvybP2KTAv0/atnajavdfAY9IWYdFKQQOUcDYbHDz J5AwEZBtr/TSgffMAKhc33T8EdvQrGy03kleCSiDhQyYmklSv2ZYrXoyKwuRy9kRvCHz yW3IP63agmHBjOxITJTQQvT3FBJmQuJzgY05+d9m+ReOA+OIis05/FkgQYC3Xoi50rTx iDjw== X-Gm-Message-State: AODbwcCk2xWQX67D1WgpbUOUgTKvVSkIKcWw6NQRICaPpfN05HjVHfku OnYsEAqf4gMd2A== X-Received: by 10.98.40.198 with SMTP id o189mr45845277pfo.238.1497054445692; Fri, 09 Jun 2017 17:27:25 -0700 (PDT) Received: from localhost.localdomain (c-73-93-215-6.hsd1.ca.comcast.net. [73.93.215.6]) by smtp.gmail.com with ESMTPSA id j71sm5622878pge.63.2017.06.09.17.27.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Jun 2017 17:27:25 -0700 (PDT) From: frowand.list@gmail.com To: Fu Wei , Mark Rutland , Marc Zyngier , Daniel Lezcano , Thomas Gleixner Subject: [PATCH] clocksource: fix read and iounmap of incorrect variable Date: Fri, 9 Jun 2017 17:26:32 -0700 Message-Id: <1497054392-13783-1-git-send-email-frowand.list@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170609_172746_882056_4AB62703 X-CRM114-Status: GOOD ( 12.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Frank Rowand Fix boot warning 'Trying to vfree() nonexistent vm area' from arch_timer_mem_of_init(). Refactored code attempts to read and iounmap using address frame instead of address ioremap(frame->cntbase). Fixes: c389d701dfb70 ("clocksource: arm_arch_timer: split MMIO timer probing.") Signed-off-by: Frank Rowand Reviewed-by: Fu Wei Acked-by: Marc Zyngier --- WARNING: CPU: 0 PID: 0 at mm/vmalloc.c:1514 iounmap+0x14/0x18 Trying to vfree() nonexistent vm area (ee821000) Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.12.0-rc1-dirty #1 Hardware name: Generic DT based system [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x6c/0x8c) [] (dump_stack) from [] (__warn+0xd0/0xf8) [] (__warn) from [] (warn_slowpath_fmt+0x38/0x48) [] (warn_slowpath_fmt) from [] (iounmap+0x14/0x18) [] (iounmap) from [] (arch_timer_mem_of_init+0x224/0x414) [] (arch_timer_mem_of_init) from [] (clocksource_probe+0x44/0xa8) [] (clocksource_probe) from [] (start_kernel+0x228/0x3a0) [] (start_kernel) from [<0020807c>] (0x20807c) drivers/clocksource/arm_arch_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 4bed671e490e..8b5c30062d99 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -1209,9 +1209,9 @@ static int __init arch_timer_of_init(struct device_node *np) return 0; } - rate = readl_relaxed(frame + CNTFRQ); + rate = readl_relaxed(base + CNTFRQ); - iounmap(frame); + iounmap(base); return rate; }