Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp756104imm; Wed, 25 Jul 2018 05:48:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcfZM1IaYi+JAyfKz2Ql/iS6vZUrsbjrST49S3mHSNLgTxR2cphCrD7iBJyY92IFvH9/TNK X-Received: by 2002:a62:d646:: with SMTP id r67-v6mr22220303pfg.130.1532522919219; Wed, 25 Jul 2018 05:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532522919; cv=none; d=google.com; s=arc-20160816; b=NeD8HG427mdzbst0Wy6BGrHphUEd8oyQHCv6qk9D2QGkyi3ccsV1EXVdaBBvgwPuYc vUI1ycSgXMo2LyKQ0R3P91Z1bDDWgnvXmAOg4D9khJv5+xEHSUCtagHAKPnr/fdTOey0 GGGky4qFalULoA0I2IcKEtYf96XwzxSP+D7pI493ii9tZWLhawxT2YMFnlciiCLX1Flr 45woyodOMD2pCeU+8BgdSOQlkzzVNL8dLek+7QkX8T7SF1+8XjOMaJ4u3WaDE4+ZuWma 2zDIwdVfnDGTgPGQcPkGH1cU37gv0bAXNVODNIL3dTHFr4nZYG55BtOWthDFWTpaFYXR MRkw== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=qip9NVbds1y3ZGb97FAxbQTq+GascPCFy0o4tB38RcM=; b=LTnvfQR2RTZ9ZbT7KTkzDJ2imq7Ww2sRSLiRXh+hZdr2TxmbCfbs5SrAK15JaXHvzP ZWbYOUk8/OIXcIQKaI+vhn1MuzT2/BzvKF5wrRTeAIl4DDh6fd6VVMq2lvUMZ+LYAOVx JeSATVuTFIRcWpa0+ZrmoWwlmGcmKeZkqF+z2FfOmu6IB4GEjrUUEUUjC+MZXporGHiS g3l25o/UrlLkgadVjok+cfCDhD0bLKpNeHNoX968O/29kGj492LkZAqxO+TY9/jZyH7S hGrUn3iR80iLJeCWH1TiweLuHxqRCYrvAOwP80fkcA3bX8s2YFeINI/kACOZU7lhrY82 Rk9g== 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 v71-v6si15401468pfj.354.2018.07.25.05.48.22; Wed, 25 Jul 2018 05:48:39 -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 S1728990AbeGYN7C convert rfc822-to-8bit (ORCPT + 99 others); Wed, 25 Jul 2018 09:59:02 -0400 Received: from mail.bootlin.com ([62.4.15.54]:34034 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728927AbeGYN7C (ORCPT ); Wed, 25 Jul 2018 09:59:02 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id A5D9C20765; Wed, 25 Jul 2018 14:47:27 +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, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from xps13 (AAubervilliers-681-1-78-122.w90-88.abo.wanadoo.fr [90.88.20.122]) by mail.bootlin.com (Postfix) with ESMTPSA id 0DA26206A6; Wed, 25 Jul 2018 14:47:17 +0200 (CEST) Date: Wed, 25 Jul 2018 14:47:17 +0200 From: Miquel Raynal To: Boris Brezillon Cc: Masahiro Yamada , 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: <20180725144717.604d3197@xps13> In-Reply-To: <20180725115116.1fb38fe3@bbrezillon> References: <20180720151527.16038-1-miquel.raynal@bootlin.com> <20180720151527.16038-5-miquel.raynal@bootlin.com> <20180725115116.1fb38fe3@bbrezillon> Organization: Bootlin 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=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, Boris Brezillon wrote on Wed, 25 Jul 2018 11:51:16 +0200: > 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(). > Absolutely, thanks for reviewing! I'll apply with this changed. Miquèl