From patchwork Wed May 9 15:11:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Khoroshilov X-Patchwork-Id: 10389729 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 9B15C60318 for ; Wed, 9 May 2018 15:14:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AE2C29212 for ; Wed, 9 May 2018 15:14:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 179C1290F0; Wed, 9 May 2018 15:14:36 +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 D7B34292B9 for ; Wed, 9 May 2018 15:11:41 +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:In-Reply-To: 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: References:List-Owner; bh=Tk/Jw/OdhBg4wF+WWH6Ikhvc/xSNsX42fixW/hxYocI=; b=ajH OQY+WS54W95L5Bjdn56iDAzBmRTCBS+j9K0a8IYycSbKOHqAN7Vxriwb/zivTDAtOtIqdsFOuo/s7 8sP+SNDpFTNzzb3HS3yw+eSsmBNC858HjWZ0kbSldSbzk4Dp0QBz9j58/p4znDaVbYpg42iJBdX5m sVqGm0wh7u+Vc5wmST1tH1kLe05lsUt2WB2AfVFtizHziVHZtsHmXNZ9HPE3y30F40ivA2MQ9Ku5O HBxw/b6OpiI6aCs0vk6mRL1pcfymGSJyR2WoMNDM/gluKRd3MFG8H5ryRwZbuPaQ9rCGuU3bpRT1W U1H0h9dGoc+IoDURz/n5KQVjSNIz51A==; 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 1fGQkj-0001xS-1C; Wed, 09 May 2018 15:11:37 +0000 Received: from mail.ispras.ru ([83.149.199.45]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGQkf-0001wP-Ny; Wed, 09 May 2018 15:11:35 +0000 Received: from hednb3.intra.ispras.ru (pluton2.ispras.ru [83.149.199.44]) by mail.ispras.ru (Postfix) with ESMTPSA id CFF8D5401D0; Wed, 9 May 2018 18:11:22 +0300 (MSK) From: Alexey Khoroshilov To: Joachim Eastwood , Brian Norris , Boris Brezillon Subject: [PATCH v3] mtd: nxp-spifi: release flash_np in nxp_spifi_probe() Date: Wed, 9 May 2018 18:11:20 +0300 Message-Id: <1525878680-22005-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20180509170310.65d19c49@bbrezillon> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180509_081133_971359_E098E92E X-CRM114-Status: UNSURE ( 7.38 ) 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: ldv-project@linuxtesting.org, sil2review@lists.osadl.org, Richard Weinberger , linux-kernel@vger.kernel.org, Julia Lawall , linux-mtd@lists.infradead.org, Alexey Khoroshilov , 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 nxp_spifi_probe() increments refcnt of SPI flash device node by of_get_next_available_child() and leaves it undecremented on both successful and error paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- v3: Move of_node_put() before return value check as Boris Brezillon suggested. drivers/mtd/spi-nor/nxp-spifi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi-nor/nxp-spifi.c b/drivers/mtd/spi-nor/nxp-spifi.c index 15374216d4d9..0c9094ec5966 100644 --- a/drivers/mtd/spi-nor/nxp-spifi.c +++ b/drivers/mtd/spi-nor/nxp-spifi.c @@ -436,6 +436,7 @@ static int nxp_spifi_probe(struct platform_device *pdev) } ret = nxp_spifi_setup_flash(spifi, flash_np); + of_node_put(flash_np); if (ret) { dev_err(&pdev->dev, "unable to setup flash chip\n"); goto dis_clks;