aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorClement Perrochaud <clement.perrochaud@nxp.com>2014-04-08 07:13:49 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2014-04-21 18:37:29 -0400
commit12b25dbf119337ce51dc93e5ecd7cbe891877328 (patch)
tree5637d0a50d2fba4b72e15d7c5e206768837dc7d3 /drivers/nfc
parent742b1f9fa292a1b8f5c8368464e114c9b71c2a81 (diff)
NFC: pn544_i2c: Fix null pointer exception when not using platform data
Fixes a null pointer exception occurring when the IRQ request in pn544_hci_i2c_probe fails and no platform data is available. Signed-off-by: Clément Perrochaud <clement.perrochaud@nxp.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/pn544/i2c.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c
index 5239e3b54120..440291ab7263 100644
--- a/drivers/nfc/pn544/i2c.c
+++ b/drivers/nfc/pn544/i2c.c
@@ -1029,8 +1029,12 @@ err_hci:
1029 free_irq(client->irq, phy); 1029 free_irq(client->irq, phy);
1030 1030
1031err_rti: 1031err_rti:
1032 if (pdata->free_resources != NULL) 1032 if (!pdata) {
1033 gpio_free(phy->gpio_en);
1034 gpio_free(phy->gpio_fw);
1035 } else if (pdata->free_resources) {
1033 pdata->free_resources(); 1036 pdata->free_resources();
1037 }
1034 1038
1035 return r; 1039 return r;
1036} 1040}