From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00044C433F5 for ; Sat, 25 Sep 2021 16:06:00 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 356CE6109D for ; Sat, 25 Sep 2021 16:06:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 356CE6109D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 375408354C; Sat, 25 Sep 2021 18:05:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="q5dmXg1x"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 842A783562; Sat, 25 Sep 2021 18:05:56 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9457E8354C for ; Sat, 25 Sep 2021 18:05:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 7EF156108B; Sat, 25 Sep 2021 16:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632585947; bh=krx/+cHgqTV0a5654V9v4ttj74YLiz/ODi3npCigEo4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q5dmXg1x63iSnosErqGGPXF74oqPOSyN28mxWYtgC/kjg+RgckP8RbFb0mKBy6WGV vWrkuZRZO5J2HiTsYse2HQcGpDc0etQVKvATDq79AfxLKGvoYnE8KurvjLA92m6cZ4 HgsXDEtdsarJOyDEijXIZSPvr85Mcbs+GuZl23TIp6iRljVNSWPKcXURgATwd+/+xI cKqKVxJsWLRRVF5AVekUy7r7bPZCG6OgceG5vbp6ld9/ceGSOD7UMyxFy7i+B+BeEz hFdPKc05Eky4JBP8PV0cKNJqu3OVsgS1KrvWYAHBy5xy/UzY+5nb2zW84uFgeGG/TZ 3IT2TzakNvTnQ== Received: by pali.im (Postfix) id 04EF3847; Sat, 25 Sep 2021 18:05:44 +0200 (CEST) Date: Sat, 25 Sep 2021 18:05:44 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Marek =?utf-8?B?QmVow7pu?= , Stefan Roese Cc: u-boot@lists.denx.de, Marek =?utf-8?B?QmVow7pu?= Subject: Re: [PATCH u-boot-marvell] arm: mvebu: turris_omnia: fix leaked mtd device Message-ID: <20210925160544.iqa34oz5ezlhbxr4@pali> References: <20210925004918.30818-1-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210925004918.30818-1-kabel@kernel.org> User-Agent: NeoMutt/20180716 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Saturday 25 September 2021 02:49:18 Marek Behún wrote: > From: Marek Behún > > After getting MTD device via get_mtd_device_nm(), we need to put it with > put_mtd_device(), otherwise we get > > Removing MTD device #0 (mx25l6405d) with use count 1 > > before booting kernel. > > Signed-off-by: Marek Behún Reviewed-by: Pali Rohár Tested-by: Pali Rohár Fixes: 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB") Above commit was introduced in v2021.10-rc1, so I think this fixup should go into v2021.10. Stefan, what do you think? > --- > board/CZ.NIC/turris_omnia/turris_omnia.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c > index bac78af04e..a48e1f5c30 100644 > --- a/board/CZ.NIC/turris_omnia/turris_omnia.c > +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c > @@ -647,10 +647,13 @@ int ft_board_setup(void *blob, struct bd_info *bd) > if (!fixup_mtd_partitions(blob, node, mtd)) > goto fail; > > + put_mtd_device(mtd); > return 0; > > fail: > printf("Failed fixing SPI NOR partitions!\n"); > + if (!IS_ERR_OR_NULL(mtd)) > + put_mtd_device(mtd); > return 0; > } > #endif > -- > 2.32.0 >