aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2013-05-10 09:53:29 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-14 07:45:00 -0400
commitee656e9d0993144f4e4ad261aefeeaab9554cd3f (patch)
tree03d990b310cd75edfcf6079777c6619ff4b50ebc /net/nfc
parent2757c3723c3d2b13e3a8bfaa034826f64e9cca43 (diff)
NFC: Remove and free all SEs when releasing an NFC device
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/core.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c
index bb5f16cfc201..5b60b9ddfc8f 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -820,11 +820,19 @@ EXPORT_SYMBOL(nfc_remove_se);
820static void nfc_release(struct device *d) 820static void nfc_release(struct device *d)
821{ 821{
822 struct nfc_dev *dev = to_nfc_dev(d); 822 struct nfc_dev *dev = to_nfc_dev(d);
823 struct nfc_se *se, *n;
823 824
824 pr_debug("dev_name=%s\n", dev_name(&dev->dev)); 825 pr_debug("dev_name=%s\n", dev_name(&dev->dev));
825 826
826 nfc_genl_data_exit(&dev->genl_data); 827 nfc_genl_data_exit(&dev->genl_data);
827 kfree(dev->targets); 828 kfree(dev->targets);
829
830 list_for_each_entry_safe(se, n, &dev->secure_elements, list) {
831 nfc_genl_se_removed(dev, se->idx);
832 list_del(&se->list);
833 kfree(se);
834 }
835
828 kfree(dev); 836 kfree(dev);
829} 837}
830 838