Skip to content

Commit

Permalink
Bluetooth: Use devm_kzalloc in bluecard_cs.c file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sachin Kamat authored and Gustavo Padovan committed Aug 6, 2012
1 parent 0213cd8 commit 1a31c60
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/bluetooth/bluecard_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}


Expand Down

0 comments on commit 1a31c60

Please sign in to comment.