diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2019-07-02 11:24:51 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2019-09-05 17:42:28 +0200 |
commit | 2fc446487c364bf8bbd5f8f5f27e52d914fa1d72 (patch) | |
tree | efdadb4b911a94b93a5b75786baea74aed864646 | |
parent | 4a926e302263946617a5dccdf065e872534b0b55 (diff) |
mt76: mt7615: always release sem in mt7615_load_patch
Release patch semaphore even if request_firmware fails in
mt7615_load_patch
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index de371bd2e0b9..00f395dc75a6 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -314,9 +314,9 @@ static int mt7615_driver_own(struct mt7615_dev *dev) static int mt7615_load_patch(struct mt7615_dev *dev) { - const struct firmware *fw; - const struct mt7615_patch_hdr *hdr; const char *firmware = MT7615_ROM_PATCH; + const struct mt7615_patch_hdr *hdr; + const struct firmware *fw = NULL; int len, ret, sem; sem = mt7615_mcu_patch_sem_ctrl(dev, 1); @@ -332,7 +332,7 @@ static int mt7615_load_patch(struct mt7615_dev *dev) ret = request_firmware(&fw, firmware, dev->mt76.dev); if (ret) - return ret; + goto out; if (!fw || !fw->data || fw->size < sizeof(*hdr)) { dev_err(dev->mt76.dev, "Invalid firmware\n"); |