Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171AbdHQNEc convert rfc822-to-8bit (ORCPT ); Thu, 17 Aug 2017 09:04:32 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:34687 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752873AbdHQNE3 (ORCPT ); Thu, 17 Aug 2017 09:04:29 -0400 Date: Thu, 17 Aug 2017 15:03:54 +0200 From: Boris Brezillon To: Christophe JAILLET Cc: dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, richard@nod.at, cyrille.pitchen@wedev4u.fr, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] mtd: physmap_of: Fix resources leak in 'of_flash_probe()' Message-ID: <20170817150354.56cdd114@bbrezillon> In-Reply-To: <20170806125501.10368-1-christophe.jaillet@wanadoo.fr> References: <20170806125501.10368-1-christophe.jaillet@wanadoo.fr> X-Mailer: Claws Mail 3.14.1 (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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1106 Lines: 36 Le Sun, 6 Aug 2017 14:55:01 +0200, Christophe JAILLET a écrit : > If 'of_flash_probe_gemini()' or 'of_flash_probe_versatile()' fail, we must > reslease some resources, as already done in all error handling paths in > this function. Applied to l2-mtd/master. Thanks, Boris > > Signed-off-by: Christophe JAILLET > --- > drivers/mtd/maps/physmap_of_core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/mtd/maps/physmap_of_core.c b/drivers/mtd/maps/physmap_of_core.c > index 62fa6836f218..2c8cc97ce019 100644 > --- a/drivers/mtd/maps/physmap_of_core.c > +++ b/drivers/mtd/maps/physmap_of_core.c > @@ -235,10 +235,10 @@ static int of_flash_probe(struct platform_device *dev) > > err = of_flash_probe_gemini(dev, dp, &info->list[i].map); > if (err) > - return err; > + goto err_out; > err = of_flash_probe_versatile(dev, dp, &info->list[i].map); > if (err) > - return err; > + goto err_out; > > err = -ENOMEM; > info->list[i].map.virt = ioremap(info->list[i].map.phys,