[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210305033115.6015-1-baijiaju1990@gmail.com>
Date: Thu, 4 Mar 2021 19:31:15 -0800
From: Jia-Ju Bai <baijiaju1990@...il.com>
To: kvalo@...eaurora.org, davem@...emloft.net, kuba@...nel.org,
lee.jones@...aro.org, colin.king@...onical.com
Cc: linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Jia-Ju Bai <baijiaju1990@...il.com>
Subject: [PATCH] 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.
Reported-by: TOTE Robot <oslab@...nghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@...il.com>
---
drivers/net/wireless/marvell/libertas_tf/if_usb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/marvell/libertas_tf/if_usb.c b/drivers/net/wireless/marvell/libertas_tf/if_usb.c
index a92916dc81a9..ceca22da5a29 100644
--- a/drivers/net/wireless/marvell/libertas_tf/if_usb.c
+++ b/drivers/net/wireless/marvell/libertas_tf/if_usb.c
@@ -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) {
--
2.17.1
Powered by blists - more mailing lists