Bluetooth: Use devm_kzalloc in bluecard_cs.c file
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Sat Sep 29 10:59:24 EDT 2012
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=1a31c602c3f6de9383eaae28e25859b6304fc3c2
Commit: 1a31c602c3f6de9383eaae28e25859b6304fc3c2
Parent: 0213cd8d5ed9cee1d7ffd95566319af1bb36a604
Author: Sachin Kamat <sachin.kamat at linaro.org>
AuthorDate: Fri Jul 27 12:38:33 2012 +0530
Committer: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
CommitDate: Mon Aug 6 15:03:00 2012 -0300
Bluetooth: Use devm_kzalloc in bluecard_cs.c file
devm_kzalloc() eliminates the need to free memory explicitly
thereby saving some cleanup code.
Signed-off-by: Sachin Kamat <sachin.kamat at linaro.org>
Acked-by: Marcel Holtmann <marcel at holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
---
drivers/bluetooth/bluecard_cs.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index 66c3a67..0c0838d 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -849,7 +849,7 @@ static int bluecard_probe(struct pcmcia_device *link)
bluecard_info_t *info;
/* Create new info device */
- info = kzalloc(sizeof(*info), GFP_KERNEL);
+ info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
@@ -864,10 +864,7 @@ static int bluecard_probe(struct pcmcia_device *link)
static void bluecard_detach(struct pcmcia_device *link)
{
- bluecard_info_t *info = link->priv;
-
bluecard_release(link);
- kfree(info);
}
More information about the linux-mtd-cvs
mailing list