From mboxrd@z Thu Jan 1 00:00:00 1970 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> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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: >=20 > >=20 > > You need to remove kfree(denali->buf) > > from denali_remove(), right? =20 >=20 > Absolutely. >=20 > >=20 > > void denali_remove(struct denali_nand_info *denali) > > { > > struct mtd_info *mtd =3D nand_to_mtd(&denali->nand); > >=20 > > nand_release(mtd); > > kfree(denali->buf); <---- REMOVE !! > > denali_disable_irq(denali); > > } > >=20 > >=20 > > Otherwise, denali_remove() will free denali->buf twice > > because kfree(denali->buf) is called from denali_detach_chip(). =20 >=20 Absolutely, thanks for reviewing! I'll apply with this changed. Miqu=C3=A8l