提交 df2566fe 编写于 作者: C Christophe Ricard 提交者: Samuel Ortiz

NFC: st21nfcb: Remove inappropriate kfree on a previously devm_kzalloc pointer

In case of an error during driver probe, info pointer was freed with kfree.
No need to free anything when using devm_kzalloc.
Signed-off-by: NChristophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 2c376a9e
......@@ -94,23 +94,18 @@ int st21nfcb_nci_probe(struct llt_ndlc *ndlc, int phy_headroom,
phy_headroom, phy_tailroom);
if (!ndlc->ndev) {
pr_err("Cannot allocate nfc ndev\n");
r = -ENOMEM;
goto err_alloc_ndev;
return -ENOMEM;
}
info->ndlc = ndlc;
nci_set_drvdata(ndlc->ndev, info);
r = nci_register_device(ndlc->ndev);
if (r)
goto err_regdev;
return r;
err_regdev:
nci_free_device(ndlc->ndev);
if (r) {
pr_err("Cannot register nfc device to nci core\n");
nci_free_device(ndlc->ndev);
}
err_alloc_ndev:
kfree(info);
return r;
}
EXPORT_SYMBOL_GPL(st21nfcb_nci_probe);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册