Commit 12b25dbf authored by Clement Perrochaud's avatar Clement Perrochaud Committed by Samuel Ortiz

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: default avatarClément Perrochaud <clement.perrochaud@nxp.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 742b1f9f
...@@ -1029,8 +1029,12 @@ static int pn544_hci_i2c_probe(struct i2c_client *client, ...@@ -1029,8 +1029,12 @@ static int pn544_hci_i2c_probe(struct i2c_client *client,
free_irq(client->irq, phy); free_irq(client->irq, phy);
err_rti: err_rti:
if (pdata->free_resources != NULL) if (!pdata) {
gpio_free(phy->gpio_en);
gpio_free(phy->gpio_fw);
} else if (pdata->free_resources) {
pdata->free_resources(); pdata->free_resources();
}
return r; return r;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment