All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: Belisko Marek <marek.belisko@gmail.com>
Cc: Brian Norris <computersforpeace@gmail.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Pekon Gupta <pekon@ti.com>, Felipe Balbi <balbi@ti.com>
Subject: Re: [PATCH 4/5] mtd: nand: omap2: Use devm_kzalloc
Date: Thu, 24 Oct 2013 19:50:50 -0300	[thread overview]
Message-ID: <20131024225049.GB20462@localhost> (raw)
In-Reply-To: <CAAfyv37SL94Ohwqqs6u5AMvdj4aAgQMGRe_9zze=TcS5An_U0w@mail.gmail.com>

On Fri, Oct 25, 2013 at 12:24:38AM +0200, Belisko Marek wrote:
> Hi,
> 
> On Fri, Oct 25, 2013 at 12:12 AM, Ezequiel Garcia
> <ezequiel.garcia@free-electrons.com> wrote:
> > This simplifies the error path and makes the code less error-prone.
> >
> > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > ---
> >  drivers/mtd/nand/omap2.c | 6 +-----
> >  1 file changed, 1 insertion(+), 5 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> > index e01a936..d4cafb0 100644
> > --- a/drivers/mtd/nand/omap2.c
> > +++ b/drivers/mtd/nand/omap2.c
> > @@ -1837,7 +1837,7 @@ static int omap_nand_probe(struct platform_device *pdev)
> >                 return -ENODEV;
> >         }
> >
> > -       info = kzalloc(sizeof(struct omap_nand_info), GFP_KERNEL);
> > +       info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
> >         if (!info)
> >                 return -ENOMEM;
> >
> > @@ -2066,9 +2066,6 @@ out_release_mem_region:
> >         if (info->gpmc_irq_fifo > 0)
> >                 free_irq(info->gpmc_irq_fifo, info);
> >         release_mem_region(info->phys_base, info->mem_size);
> > -out_free_info:
> You remove ^^^^ statement but it's still used in line ~1868 as return when
> cannot get resource.

Right, I missed that. This happens when you do two cleanups at once and then
try to commit them separatedly!

Thanks!
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com

WARNING: multiple messages have this Message-ID (diff)
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: Belisko Marek <marek.belisko@gmail.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Pekon Gupta <pekon@ti.com>, Felipe Balbi <balbi@ti.com>
Subject: Re: [PATCH 4/5] mtd: nand: omap2: Use devm_kzalloc
Date: Thu, 24 Oct 2013 19:50:50 -0300	[thread overview]
Message-ID: <20131024225049.GB20462@localhost> (raw)
In-Reply-To: <CAAfyv37SL94Ohwqqs6u5AMvdj4aAgQMGRe_9zze=TcS5An_U0w@mail.gmail.com>

On Fri, Oct 25, 2013 at 12:24:38AM +0200, Belisko Marek wrote:
> Hi,
> 
> On Fri, Oct 25, 2013 at 12:12 AM, Ezequiel Garcia
> <ezequiel.garcia@free-electrons.com> wrote:
> > This simplifies the error path and makes the code less error-prone.
> >
> > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > ---
> >  drivers/mtd/nand/omap2.c | 6 +-----
> >  1 file changed, 1 insertion(+), 5 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> > index e01a936..d4cafb0 100644
> > --- a/drivers/mtd/nand/omap2.c
> > +++ b/drivers/mtd/nand/omap2.c
> > @@ -1837,7 +1837,7 @@ static int omap_nand_probe(struct platform_device *pdev)
> >                 return -ENODEV;
> >         }
> >
> > -       info = kzalloc(sizeof(struct omap_nand_info), GFP_KERNEL);
> > +       info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
> >         if (!info)
> >                 return -ENOMEM;
> >
> > @@ -2066,9 +2066,6 @@ out_release_mem_region:
> >         if (info->gpmc_irq_fifo > 0)
> >                 free_irq(info->gpmc_irq_fifo, info);
> >         release_mem_region(info->phys_base, info->mem_size);
> > -out_free_info:
> You remove ^^^^ statement but it's still used in line ~1868 as return when
> cannot get resource.

Right, I missed that. This happens when you do two cleanups at once and then
try to commit them separatedly!

Thanks!
-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-10-24 22:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 22:12 [PATCH 0/5] Assorted OMAP2 NAND clean-ups Ezequiel Garcia
2013-10-24 22:12 ` Ezequiel Garcia
2013-10-24 22:12 ` [PATCH 1/5] ARM: am335x-bone: Add support for 16-bit NAND cape Ezequiel Garcia
2013-10-24 22:12   ` Ezequiel Garcia
2013-10-24 22:12 ` [PATCH 2/5] mtd: nand: omap2: Fix device detection path Ezequiel Garcia
2013-10-24 22:12   ` Ezequiel Garcia
2013-10-24 22:12 ` [PATCH 3/5] mtd: nand: omap2: Fix OMAP_BCH option dependency Ezequiel Garcia
2013-10-24 22:12   ` Ezequiel Garcia
2013-10-24 22:12 ` [PATCH 4/5] mtd: nand: omap2: Use devm_kzalloc Ezequiel Garcia
2013-10-24 22:12   ` Ezequiel Garcia
2013-10-24 22:24   ` Belisko Marek
2013-10-24 22:24     ` Belisko Marek
2013-10-24 22:50     ` Ezequiel Garcia [this message]
2013-10-24 22:50       ` Ezequiel Garcia
2013-10-24 22:12 ` [PATCH 5/5] mtd: nand: omap2: Use devm_ioremap_resource Ezequiel Garcia
2013-10-24 22:12   ` Ezequiel Garcia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131024225049.GB20462@localhost \
    --to=ezequiel.garcia@free-electrons.com \
    --cc=balbi@ti.com \
    --cc=computersforpeace@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=marek.belisko@gmail.com \
    --cc=pekon@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.