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: 910920 X-Patchwork-Delegate: boris.brezillon@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ispras.ru Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MV7MuQnb"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40h0G125sRz9s4r for ; Thu, 10 May 2018 01:12:25 +1000 (AEST) 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=PxVsWpV2IYfLO2ZsCm05URGmN84IP4f5ZVoI638u2D4=; b=MV7 MuQnblYPM7adYQDI2bzIqv7BwPUFp13fwvOOFAhWyCGMVIvgNqdZxfPdCOMXAz153kiUL0GhVixVw tVPp1VIQaRDn1YnDnSIJJR0UAJ7LdOm+OdPVqNfqJD7JE1OJbe5GKCOqY1vhrcwGusnDEtz/M6FUB +cGA1y5Fo/nqC2XGiZ1VDo8NqDXOeDUF5Yo+TQGNCfXHoV5y2jLOQnEei+6oLwH3lEj0twxqW1EDT 7opuVZzzNKCPizl4b1AkKLom7iztE3ZDBDXqf5iEZTXaURl5W/D1mWVcfUPLZrekQWPZP8/T3Iaf6 4kv6VSkOESRQAAJDp0N/Hs0jQ7mNNDQ==; 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 1fGQlE-0002Ck-Bn; Wed, 09 May 2018 15:12:08 +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-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [83.149.199.45 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list 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-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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;