From: Himangi Saraogi <himangi774@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
Olof Johansson <olof@lixom.net>, Daniel Mack <zonque@gmail.com>,
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: [PATCH] drivers: net: davinci_cpdma: drop devm_kfree of devm_kzalloc'd data
Date: Mon, 11 Aug 2014 01:28:19 +0530 [thread overview]
Message-ID: <20140810195819.GA3880@himangi-Dell> (raw)
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>
---
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);
}
--
1.9.1
next reply other threads:[~2014-08-10 19:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-10 19:58 Himangi Saraogi [this message]
2014-08-10 20:26 ` [PATCH] drivers: net: davinci_cpdma: drop devm_kfree of devm_kzalloc'd data Daniel Mack
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=20140810195819.GA3880@himangi-Dell \
--to=himangi774@gmail.com \
--cc=balbi@ti.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olof@lixom.net \
--cc=zonque@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox