From patchwork Tue Aug 14 01:54:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhong jiang X-Patchwork-Id: 10564991 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A2D113BB for ; Tue, 14 Aug 2018 02:07:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A32D29617 for ; Tue, 14 Aug 2018 02:07:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E7862961C; Tue, 14 Aug 2018 02:07:05 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 E18DC29617 for ; Tue, 14 Aug 2018 02:07:04 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=Mt7d3bEz3Shv1sy/bQhtR0QNJCcgK5YJi9IF2OpeY3M=; b=SGsBgYwzfZuzgy UcJOI7Z6H12jqQu772AWASfZjVQFHIk2bDdMkk89Y3VY1PNP1a+s2nV/JIaIHOc3vfqCybe1eEo8i tFJG2z6yR8J5jWKM9mJL8eXKqQomJINrawxQsF8ShU3Td58RZ7upMXk/6ANLmzGAynOK25/mQBQJC 1NGfsVR5PSkeTR+tbV/p9ptn2zN0uWhvsma4v4IUH9sieueD8kll8kY9mzLqAJGKAx4vJqHr6JQD5 oSiE8KjO1JPTPZfmymCVkQhz2X22q2svjSNETZ/NF8lp2Uy649AKV258tgh1e4EGxc2Q+hE2mxLLN 3OK1h44S8LzE9uvGNQqQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fpOje-0008TL-7F; Tue, 14 Aug 2018 02:07:02 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fpOja-0008SM-PF for linux-arm-kernel@lists.infradead.org; Tue, 14 Aug 2018 02:07:00 +0000 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id DA3FE60D841B5; Tue, 14 Aug 2018 10:06:42 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.399.0; Tue, 14 Aug 2018 10:06:42 +0800 From: zhong jiang To: , , Subject: [PATCH] arm/mach-at91/pm: Do not double put the device node Date: Tue, 14 Aug 2018 09:54:56 +0800 Message-ID: <1534211696-4221-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180813_190658_995801_74D19BBF X-CRM114-Status: GOOD ( 10.21 ) 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 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 Device node iterators put the previous value of the index variable, so an explicit put causes a double put. I detect the issue with the help of Coccinelle. Signed-off-by: zhong jiang --- arch/arm/mach-at91/pm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 32fae4d..a5ec35f 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -143,15 +143,12 @@ static int at91_pm_config_ws(unsigned int pm_mode, bool set) /* Check if enabled on SHDWC. */ if (wsi->shdwc_mr_bit && !(val & wsi->shdwc_mr_bit)) - goto put_node; + continue; mode |= wsi->pmc_fsmr_bit; if (wsi->set_polarity) polarity |= wsi->pmc_fsmr_bit; } - -put_node: - of_node_put(np); } if (mode) {