Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp599402imm; Wed, 25 Jul 2018 02:52:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdCTmGsaglBN3EFGR7KzgYhPqiBQBJhnytdaigkF7XrLtiBlCAAWaz6C2n4zOtWWabEkMHy X-Received: by 2002:a17:902:bd8b:: with SMTP id q11-v6mr15980847pls.254.1532512360741; Wed, 25 Jul 2018 02:52:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532512360; cv=none; d=google.com; s=arc-20160816; b=nV9hB2uuKBArfXkeq7kvDS2bBO6OiXW82s62X4c5CHJB1FW1FvACxxc6iWpoy0v6uI H8dsUnX0gvLsRdY/tbK+2ge4M83FGgoatgfp3JsRbF68yNJiLOpdn+KPhycu2CipmUWg DVj6jk6EBXUCE0aXu7QrSb4Po8RYOYE6NzZGrA/8BlUuryaMNIpSjCzwXc1bBpiEdyNA kqPmIk+aOhU+B2SJl6XvDydPJ5TG5cpXXRXsk3IGqMmAM41wxHcWsPEtNr+RwV4npD4o /Icll5/NRtIXIh+bOxJNS+6Mk7i35p+pIvCIMhPlT2qMXf1wg+eNUBQIC1dVApR3yFaI 5ZVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=QdkUYCBfuDBLDGfUtSWPaci92EDK3ol5CkNb+GuKypg=; b=vN0E+Bmjs9td5ZIthlS+TvtWOYYea1Lo9sWZfppWLIYQOpaLKFT8/GmH81hYVTupmD Kg65P6maqLL6FRDmHSPzDjBmxodrJwSszwDpOOTr5X4jgvtGBTf5JgyM9QK3MuChl4wl 5OLWdWUmJPW7kN+/i7Dc4JOhGDlYmIQN0AZeJbzeXQFTO1Xxz1D4AkDzHckcywH481t6 Rs2Xp8Khr0yfSsSht4aUcpwPPT9DEWX35Ko93+Yz0A3YAwof0Zw2l8bVp7I89rYahuGo KfxtWRDYva9L1SnXilvHxqnw+vNxwLE144EcSuJoTXS8iIvGmfPbVF3gASU1pGib1utI 57Lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q74-v6si14835197pfq.32.2018.07.25.02.52.26; Wed, 25 Jul 2018 02:52:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728828AbeGYLCO (ORCPT + 99 others); Wed, 25 Jul 2018 07:02:14 -0400 Received: from mail.bootlin.com ([62.4.15.54]:57332 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728589AbeGYLCO (ORCPT ); Wed, 25 Jul 2018 07:02:14 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 9E28D2072C; Wed, 25 Jul 2018 11:51:16 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-78-122.w90-88.abo.wanadoo.fr [90.88.20.122]) by mail.bootlin.com (Postfix) with ESMTPSA id D2BDA207B3; Wed, 25 Jul 2018 11:51:15 +0200 (CEST) Date: Wed, 25 Jul 2018 11:51:16 +0200 From: Boris Brezillon To: Masahiro Yamada Cc: Miquel Raynal , Alexandre Belloni , Mans Rullgard , Maxime Ripard , Stefan Agner , Linux Kernel Mailing List , linux-mtd , Kamal Dasu , Josh Wu , Marc Gonzalez , Marek Vasut , Chen-Yu Tsai , Broadcom Kernel Feedback List , Sylvain Lemieux , Wenyou Yang , Tudor Ambarus , Vladimir Zapolskiy , Harvey Hunt , "moderated list:ARM/Mediatek SoC support" , Matthias Brugger , Han Xu , Xiaolei Li , linux-arm-kernel , Nicolas Ferre , Richard Weinberger , Brian Norris , David Woodhouse Subject: Re: [PATCH v4 04/35] mtd: rawnand: denali: convert to nand_scan() Message-ID: <20180725115116.1fb38fe3@bbrezillon> In-Reply-To: References: <20180720151527.16038-1-miquel.raynal@bootlin.com> <20180720151527.16038-5-miquel.raynal@bootlin.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Jul 2018 18:42:44 +0900 Masahiro Yamada wrote: > > You need to remove kfree(denali->buf) > from denali_remove(), right? Absolutely. > > void denali_remove(struct denali_nand_info *denali) > { > struct mtd_info *mtd = nand_to_mtd(&denali->nand); > > nand_release(mtd); > kfree(denali->buf); <---- REMOVE !! > denali_disable_irq(denali); > } > > > Otherwise, denali_remove() will free denali->buf twice > because kfree(denali->buf) is called from denali_detach_chip().