All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: imx: add missing kfree call in error paths
Date: Thu, 22 May 2014 20:12:40 +0000	[thread overview]
Message-ID: <20140522201240.GL15585@mwanda> (raw)
In-Reply-To: <20140522144446.GA7348@lianli>

On Thu, May 22, 2014 at 04:44:46PM +0200, Emil Goode wrote:
> Hello Dan,
> 
> On Thu, May 22, 2014 at 04:50:16PM +0300, Dan Carpenter wrote:
> > On Thu, May 22, 2014 at 03:14:42PM +0200, Emil Goode wrote:
> > > We forgot to free pdev->dev.dma_mask as it is not freed
> > > by platform_device_put().
> > > 
> > 
> > Every function which calls imx31_alloc_mx3_camera() is buggy.  That
> > means that, at best, it is a 2 on Rusty's API rating.
> > http://sweng.the-davies.net/Home/rustys-api-design-manifesto
> > 
> > The correct fix is to introduce an imx31_free_mx3_camera() otherwise we
> > will just keep introducing these bugs.
> 
> I guess I could add this to arch/arm/mach-imx/devices/platform-ipu-core.c
> it would be a very small function though.

A small function is fine.  :)

regards,
dan carpenter


WARNING: multiple messages have this Message-ID (diff)
From: dan.carpenter@oracle.com (Dan Carpenter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx: add missing kfree call in error paths
Date: Thu, 22 May 2014 23:12:40 +0300	[thread overview]
Message-ID: <20140522201240.GL15585@mwanda> (raw)
In-Reply-To: <20140522144446.GA7348@lianli>

On Thu, May 22, 2014 at 04:44:46PM +0200, Emil Goode wrote:
> Hello Dan,
> 
> On Thu, May 22, 2014 at 04:50:16PM +0300, Dan Carpenter wrote:
> > On Thu, May 22, 2014 at 03:14:42PM +0200, Emil Goode wrote:
> > > We forgot to free pdev->dev.dma_mask as it is not freed
> > > by platform_device_put().
> > > 
> > 
> > Every function which calls imx31_alloc_mx3_camera() is buggy.  That
> > means that, at best, it is a 2 on Rusty's API rating.
> > http://sweng.the-davies.net/Home/rustys-api-design-manifesto
> > 
> > The correct fix is to introduce an imx31_free_mx3_camera() otherwise we
> > will just keep introducing these bugs.
> 
> I guess I could add this to arch/arm/mach-imx/devices/platform-ipu-core.c
> it would be a very small function though.

A small function is fine.  :)

regards,
dan carpenter

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Emil Goode <emilgoode@gmail.com>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Shawn Guo" <shawn.guo@freescale.com>,
	"Sascha Hauer" <kernel@pengutronix.de>,
	"Russell King" <linux@arm.linux.org.uk>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ARM: imx: add missing kfree call in error paths
Date: Thu, 22 May 2014 23:12:40 +0300	[thread overview]
Message-ID: <20140522201240.GL15585@mwanda> (raw)
In-Reply-To: <20140522144446.GA7348@lianli>

On Thu, May 22, 2014 at 04:44:46PM +0200, Emil Goode wrote:
> Hello Dan,
> 
> On Thu, May 22, 2014 at 04:50:16PM +0300, Dan Carpenter wrote:
> > On Thu, May 22, 2014 at 03:14:42PM +0200, Emil Goode wrote:
> > > We forgot to free pdev->dev.dma_mask as it is not freed
> > > by platform_device_put().
> > > 
> > 
> > Every function which calls imx31_alloc_mx3_camera() is buggy.  That
> > means that, at best, it is a 2 on Rusty's API rating.
> > http://sweng.the-davies.net/Home/rustys-api-design-manifesto
> > 
> > The correct fix is to introduce an imx31_free_mx3_camera() otherwise we
> > will just keep introducing these bugs.
> 
> I guess I could add this to arch/arm/mach-imx/devices/platform-ipu-core.c
> it would be a very small function though.

A small function is fine.  :)

regards,
dan carpenter


  reply	other threads:[~2014-05-22 20:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 13:14 [PATCH] ARM: imx: add missing kfree call in error paths Emil Goode
2014-05-22 13:14 ` Emil Goode
2014-05-22 13:14 ` Emil Goode
2014-05-22 13:50 ` Dan Carpenter
2014-05-22 13:50   ` Dan Carpenter
2014-05-22 13:50   ` Dan Carpenter
2014-05-22 14:44   ` Emil Goode
2014-05-22 14:44     ` Emil Goode
2014-05-22 14:44     ` Emil Goode
2014-05-22 20:12     ` Dan Carpenter [this message]
2014-05-22 20:12       ` Dan Carpenter
2014-05-22 20:12       ` Dan Carpenter

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=20140522201240.GL15585@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.