]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Bluetooth: Use devm_kzalloc in bluecard_cs.c file
authorSachin Kamat <sachin.kamat@linaro.org>
Fri, 27 Jul 2012 07:08:33 +0000 (12:38 +0530)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Mon, 6 Aug 2012 18:03:00 +0000 (15:03 -0300)
devm_kzalloc() eliminates the need to free memory explicitly
thereby saving some cleanup code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
drivers/bluetooth/bluecard_cs.c

index 66c3a6770c417a5dbb714a9c10ae029fc2675109..0c0838d9b56c2ec266c9ad92448787576a5170d6 100644 (file)
@@ -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);
 }