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 51C93C433F5 for ; Mon, 27 Sep 2021 05:40:46 +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 4390261154 for ; Mon, 27 Sep 2021 05:40:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4390261154 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de 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 2243283246; Mon, 27 Sep 2021 07:40:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1632721243; bh=WdfrorX/zUNF/+j0pq9H9dwTifY0sDsiSTKLqA548kU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=H68/11UtxhQj3gt8mvF46gkCKMfWBPppaFZQpbEECwpwpm0ot1+gncsW9r+YwS/Kv 2M5eye6MC1yLW9sPX7ufLQb1sokNAO97ByikUO14PZ+wFndbNRNIw+7q4KU7d/VsKG lazeQi/mtSV/eYsTBnsVU/gfxbY3BhSeMeJL+fc49qHntmrsicaj0+2hdE40eqnSVg U420JL+oBAVdRSrqhpmrnHTl60vu4DLK55/9nELv73F7KJ1FzfbQjG/C+8GzRRnwMU yoyJs/u0kZ+bOQlEYN7TNgWblOZVqBvHk1gKh/B+Col8Cz5sBdbgHDKiYOsncfJ9Tm COVf/LBjG9iSw== Received: by phobos.denx.de (Postfix, from userid 109) id DEFAF82C88; Mon, 27 Sep 2021 07:40:40 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [91.198.250.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1B08C83246 for ; Mon, 27 Sep 2021 07:40:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4HHs1L0C15zQjYl; Mon, 27 Sep 2021 07:40:38 +0200 (CEST) Subject: Re: [PATCH u-boot-marvell] arm: mvebu: turris_omnia: fix leaked mtd device To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , =?UTF-8?Q?Marek_Beh=c3=ban?= Cc: u-boot@lists.denx.de, =?UTF-8?Q?Marek_Beh=c3=ban?= References: <20210925004918.30818-1-kabel@kernel.org> <20210925160544.iqa34oz5ezlhbxr4@pali> From: Stefan Roese Message-ID: <11c89e42-ab98-6e2c-3829-e9747c76e147@denx.de> Date: Mon, 27 Sep 2021 07:40:34 +0200 MIME-Version: 1.0 In-Reply-To: <20210925160544.iqa34oz5ezlhbxr4@pali> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1CD20183A 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 25.09.21 18:05, Pali Rohár wrote: > 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? Makes sense. I'll push this out today. Thanks, Stefan >> --- >> 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 >> Viele Grüße, Stefan -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de