netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: Himangi Saraogi <himangi774@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Olof Johansson <olof@lixom.net>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Felipe Balbi <balbi@ti.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Julia Lawall <julia.lawall@lip6.fr>
Subject: Re: [PATCH] drivers: net: davinci_cpdma: drop devm_kfree of devm_kzalloc'd data
Date: Sun, 10 Aug 2014 22:26:47 +0200	[thread overview]
Message-ID: <53E7D587.9040303@gmail.com> (raw)
In-Reply-To: <20140810195819.GA3880@himangi-Dell>

On 08/10/2014 09:58 PM, Himangi Saraogi wrote:
> devm_kfree should not have to be explicitly used.
> 
> The Coccinelle semantic patch that fixes this problem is as follows:
> 
> // <smpl>
> @@
> expression x,d;
> @@
> 
> x = devm_kzalloc(...)
> ...
> ?-devm_kfree(d,x);
> // </smpl>
> 
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
> Acked-by: Julia Lawall <julia.lawall@lip6.fr>

Acked-by: Daniel Mack <zonque@gmail.com>

However, you need to resend this patch after 3.17-rc1 has been released
and the net-next branch was opened again.


Thanks,
Daniel


> ---
>  drivers/net/ethernet/ti/davinci_cpdma.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c
> index 4a000f6..af673f5 100644
> --- a/drivers/net/ethernet/ti/davinci_cpdma.c
> +++ b/drivers/net/ethernet/ti/davinci_cpdma.c
> @@ -512,7 +512,6 @@ struct cpdma_chan *cpdma_chan_create(struct cpdma_ctlr *ctlr, int chan_num,
>  	spin_lock_irqsave(&ctlr->lock, flags);
>  	if (ctlr->channels[chan_num]) {
>  		spin_unlock_irqrestore(&ctlr->lock, flags);
> -		devm_kfree(ctlr->dev, chan);
>  		return ERR_PTR(-EBUSY);
>  	}
>  
> 

      reply	other threads:[~2014-08-10 20:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-10 19:58 [PATCH] drivers: net: davinci_cpdma: drop devm_kfree of devm_kzalloc'd data Himangi Saraogi
2014-08-10 20:26 ` Daniel Mack [this message]

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=53E7D587.9040303@gmail.com \
    --to=zonque@gmail.com \
    --cc=balbi@ti.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=himangi774@gmail.com \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olof@lixom.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).