diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2015-04-05 18:58:51 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-04-05 18:58:51 -0400 |
commit | 9421ce10ad87f799263bddad74b91e2166f020a1 (patch) | |
tree | 8809982d98f5ef2490e240e5ad2ff4a992238381 | |
parent | 2b591257d97550e575f761e83c607d99b0f86899 (diff) |
NFC: nxp-nci: Release firmware when switching to FW mode fails
In that case, the firmware work will never be scheduled, will
never complete and thus the firmware will never be released.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | drivers/nfc/nxp-nci/firmware.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nfc/nxp-nci/firmware.c b/drivers/nfc/nxp-nci/firmware.c index 74f98209ea82..5291797324ba 100644 --- a/drivers/nfc/nxp-nci/firmware.c +++ b/drivers/nfc/nxp-nci/firmware.c | |||
@@ -234,8 +234,10 @@ int nxp_nci_fw_download(struct nci_dev *ndev, const char *firmware_name) | |||
234 | goto fw_download_exit; | 234 | goto fw_download_exit; |
235 | 235 | ||
236 | r = info->phy_ops->set_mode(info->phy_id, NXP_NCI_MODE_FW); | 236 | r = info->phy_ops->set_mode(info->phy_id, NXP_NCI_MODE_FW); |
237 | if (r < 0) | 237 | if (r < 0) { |
238 | release_firmware(fw_info->fw); | ||
238 | goto fw_download_exit; | 239 | goto fw_download_exit; |
240 | } | ||
239 | 241 | ||
240 | info->mode = NXP_NCI_MODE_FW; | 242 | info->mode = NXP_NCI_MODE_FW; |
241 | 243 | ||