Commit 2fc44648 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: mt7615: always release sem in mt7615_load_patch

Release patch semaphore even if request_firmware fails in
mt7615_load_patch
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 4a926e30
...@@ -314,9 +314,9 @@ static int mt7615_driver_own(struct mt7615_dev *dev) ...@@ -314,9 +314,9 @@ static int mt7615_driver_own(struct mt7615_dev *dev)
static int mt7615_load_patch(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 char *firmware = MT7615_ROM_PATCH;
const struct mt7615_patch_hdr *hdr;
const struct firmware *fw = NULL;
int len, ret, sem; int len, ret, sem;
sem = mt7615_mcu_patch_sem_ctrl(dev, 1); sem = mt7615_mcu_patch_sem_ctrl(dev, 1);
...@@ -332,7 +332,7 @@ static int mt7615_load_patch(struct mt7615_dev *dev) ...@@ -332,7 +332,7 @@ static int mt7615_load_patch(struct mt7615_dev *dev)
ret = request_firmware(&fw, firmware, dev->mt76.dev); ret = request_firmware(&fw, firmware, dev->mt76.dev);
if (ret) if (ret)
return ret; goto out;
if (!fw || !fw->data || fw->size < sizeof(*hdr)) { if (!fw || !fw->data || fw->size < sizeof(*hdr)) {
dev_err(dev->mt76.dev, "Invalid firmware\n"); dev_err(dev->mt76.dev, "Invalid firmware\n");
......
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