NFC: st21nfcb: Remove inappropriate kfree on a devm_kzalloc pointer
authorFiro Yang <firogm@gmail.com>
Sat, 6 Jun 2015 11:16:42 +0000 (13:16 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 8 Jun 2015 22:34:22 +0000 (00:34 +0200)
Since ndev->driver_data is allocated by devm_kzalloc(), we do not
need the inappropriate kfree to free it in driver's remove function.
Freeing will trigger when driver unloads.

Cc: stable@vger.kernel.org
Acked-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Firo Yang <firogm@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/st21nfcb/st21nfcb.c

index ca9871ab3fb3c7040188d6ee8c6404bb26d876e5..c7dc282d5c3be3e6ef625d0a9a306aa742040de1 100644 (file)
@@ -131,11 +131,8 @@ EXPORT_SYMBOL_GPL(st21nfcb_nci_probe);
 
 void st21nfcb_nci_remove(struct nci_dev *ndev)
 {
-       struct st21nfcb_nci_info *info = nci_get_drvdata(ndev);
-
        nci_unregister_device(ndev);
        nci_free_device(ndev);
-       kfree(info);
 }
 EXPORT_SYMBOL_GPL(st21nfcb_nci_remove);