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>
This commit is contained in:
Sachin Kamat 2012-07-27 12:38:35 +05:30 committed by Gustavo Padovan
parent 704687ce17
commit 4f61cb184f
1 changed files with 1 additions and 4 deletions

View File

@ -638,7 +638,7 @@ static int bt3c_probe(struct pcmcia_device *link)
bt3c_info_t *info; bt3c_info_t *info;
/* Create new info device */ /* Create new info device */
info = kzalloc(sizeof(*info), GFP_KERNEL); info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
@ -654,10 +654,7 @@ static int bt3c_probe(struct pcmcia_device *link)
static void bt3c_detach(struct pcmcia_device *link) static void bt3c_detach(struct pcmcia_device *link)
{ {
bt3c_info_t *info = link->priv;
bt3c_release(link); bt3c_release(link);
kfree(info);
} }
static int bt3c_check_config(struct pcmcia_device *p_dev, void *priv_data) static int bt3c_check_config(struct pcmcia_device *p_dev, void *priv_data)