Skip to content

Commit 12b25db

Browse files
CPerrNXPSamuel Ortiz
authored andcommitted
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>
1 parent 742b1f9 commit 12b25db

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎drivers/nfc/pn544/i2c.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,12 @@ static int pn544_hci_i2c_probe(struct i2c_client *client,
10291029
free_irq(client->irq, phy);
10301030

10311031
err_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) {
10331036
pdata->free_resources();
1037+
}
10341038

10351039
return r;
10361040
}

0 commit comments

Comments
 (0)