From patchwork Tue Oct 24 15:02:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Pieralisi X-Patchwork-Id: 10024717 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 D44F76035E for ; Tue, 24 Oct 2017 15:03:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3345289E0 for ; Tue, 24 Oct 2017 15:03:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6AF6289EC; Tue, 24 Oct 2017 15:03:13 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED 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 47F46289E0 for ; Tue, 24 Oct 2017 15:03:13 +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=fvsM6gOfpoD3wK9oFCQ++kum3vtywTZ8SaCXKxrV0Dc=; b=USw 1YlcgBrBySfWGIPtechinQ1mLt29BsZLLrHAXQnXrc6OGnyBPHe9JZ9pQ+rcnURtVmdLOVA/mPY1E kAzwU5sWi9ScaPwPsz7BdLQz6ON8c7QskFIGHBjWD3FvyFzEgbWqeP8oWWeEGlyuGVi5jUJL+QuqW MjAqpI/1PE1v1U5mXB9A3RRtkh9AhM+7IzQHiFVfhYFRwWAeVNLTkD+smG8yYBoPhzrOyXB1bpXkL 7Yh2sTQi1hFOMuxYyLWafXBqaGp+n2Iz4Wy4PF+ql//l1l7VNNyNgYSixhAMVeUNYK30jTLddtQhO PkWbyF1Frmjvimr/rVEF+jpUZGFOjPA==; 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 1e70jV-0000rs-Ey; Tue, 24 Oct 2017 15:03:09 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e70jN-0000oG-PY for linux-arm-kernel@lists.infradead.org; Tue, 24 Oct 2017 15:03:07 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5B35B80D; Tue, 24 Oct 2017 08:02:41 -0700 (PDT) Received: from red-moon.cambridge.arm.com (red-moon.cambridge.arm.com [10.1.206.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 271E93F587; Tue, 24 Oct 2017 08:02:40 -0700 (PDT) From: Lorenzo Pieralisi To: arm@kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] drivers/firmware: psci_checker: Add missing destroy_timer_on_stack() Date: Tue, 24 Oct 2017 16:02:33 +0100 Message-Id: <1508857353-3602-1-git-send-email-lorenzo.pieralisi@arm.com> X-Mailer: git-send-email 2.4.12 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171024_080301_874291_CAC517E1 X-CRM114-Status: UNSURE ( 8.97 ) X-CRM114-Notice: Please train this message. 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: Mark Rutland , Lorenzo Pieralisi , linux-kernel@vger.kernel.org, Kees Cook 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 The PSCI checker suspend_test_thread() function (ie executed for the suspend test) requires an on-stack timer to carry out the test it executes; it sets it up through the setup_timer_on_stack() API. setup_timer_on_stack() requires its counterpart destroy_timer_on_stack() to be called when the timer is disposed of but the PSCI checker code is currently missing that call, leaving the timer object in an incosistent state when the PSCI checker stops the thread executing the suspend test. Add the missing destroy_timer_on_stack() call to fix the omission. Fixes: ea8b1c4a6019 ("drivers: psci: PSCI checker module") Signed-off-by: Lorenzo Pieralisi Reported-by: Kees Cook Cc: Kees Cook Cc: Mark Rutland --- drivers/firmware/psci_checker.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firmware/psci_checker.c b/drivers/firmware/psci_checker.c index 6523ce9..56cf825 100644 --- a/drivers/firmware/psci_checker.c +++ b/drivers/firmware/psci_checker.c @@ -340,6 +340,7 @@ static int suspend_test_thread(void *arg) * later. */ del_timer(&wakeup_timer); + destroy_timer_on_stack(&wakeup_timer); if (atomic_dec_return_relaxed(&nb_active_threads) == 0) complete(&suspend_threads_done);