Преглед изворни кода

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>
Samuel Ortiz пре 10 година
родитељ
комит
9421ce10ad
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      drivers/nfc/nxp-nci/firmware.c

+ 3 - 1
drivers/nfc/nxp-nci/firmware.c

@@ -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;