summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2012-07-27 09:08:35 +0200
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-08-06 20:03:01 +0200
commit4f61cb184fd5d16d591303aacf8dd1e623d2137d (patch)
tree6e8ab6b7b6036e1ae7fa77853337d7c38bbf2cd9 /drivers/bluetooth
parentBluetooth: Use devm_kzalloc in bpa10x.c file (diff)
downloadlinux-4f61cb184fd5d16d591303aacf8dd1e623d2137d.tar.xz
linux-4f61cb184fd5d16d591303aacf8dd1e623d2137d.zip
Bluetooth: Use devm_kzalloc in bt3c_cs.c file
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>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/bt3c_cs.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 8925b6d672a6..7ffd3f407144 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -638,7 +638,7 @@ static int bt3c_probe(struct pcmcia_device *link)
bt3c_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;
@@ -654,10 +654,7 @@ static int bt3c_probe(struct pcmcia_device *link)
static void bt3c_detach(struct pcmcia_device *link)
{
- bt3c_info_t *info = link->priv;
-
bt3c_release(link);
- kfree(info);
}
static int bt3c_check_config(struct pcmcia_device *p_dev, void *priv_data)