Skip to content

Commit

Permalink
NFC: Remove and free all SEs when releasing an NFC device
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Samuel Ortiz committed Jun 14, 2013
1 parent 2757c37 commit ee656e9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/nfc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,11 +820,19 @@ EXPORT_SYMBOL(nfc_remove_se);
static void nfc_release(struct device *d)
{
struct nfc_dev *dev = to_nfc_dev(d);
struct nfc_se *se, *n;

pr_debug("dev_name=%s\n", dev_name(&dev->dev));

nfc_genl_data_exit(&dev->genl_data);
kfree(dev->targets);

list_for_each_entry_safe(se, n, &dev->secure_elements, list) {
nfc_genl_se_removed(dev, se->idx);
list_del(&se->list);
kfree(se);
}

kfree(dev);
}

Expand Down

0 comments on commit ee656e9

Please sign in to comment.