Skip to content

Commit

Permalink
NFC: nxp-nci: Release firmware when switching to FW mode fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samuel Ortiz committed Apr 5, 2015
1 parent 2b59125 commit 9421ce1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/nfc/nxp-nci/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,10 @@ int nxp_nci_fw_download(struct nci_dev *ndev, const char *firmware_name)
goto fw_download_exit;

r = info->phy_ops->set_mode(info->phy_id, NXP_NCI_MODE_FW);
if (r < 0)
if (r < 0) {
release_firmware(fw_info->fw);
goto fw_download_exit;
}

info->mode = NXP_NCI_MODE_FW;

Expand Down

0 comments on commit 9421ce1

Please sign in to comment.