提交 cd7cf78e 编写于 作者: S Sachin Kamat 提交者: Gustavo Padovan

Bluetooth: Use devm_kzalloc in dtl1_cs.c file

devm_kzalloc() eliminates the need to free memory explicitly
thereby saving some cleanup code.
Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org>
Acked-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
上级 4f8d8158
...@@ -550,7 +550,7 @@ static int dtl1_probe(struct pcmcia_device *link) ...@@ -550,7 +550,7 @@ static int dtl1_probe(struct pcmcia_device *link)
dtl1_info_t *info; dtl1_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;
...@@ -569,7 +569,6 @@ static void dtl1_detach(struct pcmcia_device *link) ...@@ -569,7 +569,6 @@ static void dtl1_detach(struct pcmcia_device *link)
dtl1_close(info); dtl1_close(info);
pcmcia_disable_device(link); pcmcia_disable_device(link);
kfree(info);
} }
static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data) static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册