Skip to contentSkip to conversation

marvell: libertas_tf: fix error return code of if_usb_prog_firmware()

PATCH In review Jia-Ju Bai 2 participants 2 messages Mar 5, 2021 – Apr 18, 2021

Subsystems (3)
lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 marvell: libertas_tf: fix error return code of if_usb_prog_firmware()

When check_fwfile_format() fails, no error return code of if_usb_prog_firmware() is assigned.
To fix this bug, ret is assigned with -EINVAL as error return code.

---
 drivers/net/wireless/marvell/libertas_tf/if_usb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/marvell/libertas_tf/if_usb.c +3 -1
index a92916dc81a9..ceca22da5a29 100644
@@ -825,8 +825,10 @@ static int if_usb_prog_firmware(struct lbtf_private *priv)
 	}
 	kernel_param_unlock(THIS_MODULE);
 
-	if (check_fwfile_format(cardp->fw->data, cardp->fw->size))
+	if (check_fwfile_format(cardp->fw->data, cardp->fw->size)) {
+		ret = -EINVAL;
 		goto release_fw;
+	}
 
 restart:
 	if (if_usb_submit_rx_urb_fwload(cardp) < 0) {
Signature · 1 line
2.17.1
#1 lore raw
Quoted 6 lines · Jia-Ju Bai

When check_fwfile_format() fails, no error return code of if_usb_prog_firmware() is assigned.
To fix this bug, ret is assigned with -EINVAL as error return code.

Someone needs to review this.

Patch set to Changes Requested.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches