mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 07:00:48 +00:00
Bluetooth: Use devm_kzalloc in btuart_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:
parent
3a382772b5
commit
fdefa118eb
@ -567,7 +567,7 @@ static int btuart_probe(struct pcmcia_device *link)
|
||||
btuart_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;
|
||||
|
||||
@ -583,10 +583,7 @@ static int btuart_probe(struct pcmcia_device *link)
|
||||
|
||||
static void btuart_detach(struct pcmcia_device *link)
|
||||
{
|
||||
btuart_info_t *info = link->priv;
|
||||
|
||||
btuart_release(link);
|
||||
kfree(info);
|
||||
}
|
||||
|
||||
static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user