Bluetooth: Use devm_kzalloc in dtl1_cs.c file

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Sep 29 10:59:26 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=cd7cf78e9bef269ed482ad8ab572f197ae89af3c
Commit:     cd7cf78e9bef269ed482ad8ab572f197ae89af3c
Parent:     4f8d81584964730b08753da34f1e3fb7981cf742
Author:     Sachin Kamat <sachin.kamat at linaro.org>
AuthorDate: Fri Jul 27 12:38:41 2012 +0530
Committer:  Gustavo Padovan <gustavo.padovan at collabora.co.uk>
CommitDate: Mon Aug 6 15:03:02 2012 -0300

    Bluetooth: Use devm_kzalloc in dtl1_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/dtl1_cs.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 97a7784..036cb36 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -550,7 +550,7 @@ static int dtl1_probe(struct pcmcia_device *link)
 	dtl1_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;
 
@@ -569,7 +569,6 @@ static void dtl1_detach(struct pcmcia_device *link)
 
 	dtl1_close(info);
 	pcmcia_disable_device(link);
-	kfree(info);
 }
 
 static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data)



More information about the linux-mtd-cvs mailing list