linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] marvell: libertas_tf: fix error return code of if_usb_prog_firmware()
@ 2021-03-05  3:31 Jia-Ju Bai
  2021-04-18  5:54 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Jia-Ju Bai @ 2021-03-05  3:31 UTC (permalink / raw)
  To: kvalo, davem, kuba, lee.jones, colin.king
  Cc: linux-wireless, netdev, linux-kernel, 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.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] marvell: libertas_tf: fix error return code of if_usb_prog_firmware()
  2021-03-05  3:31 [PATCH] marvell: libertas_tf: fix error return code of if_usb_prog_firmware() Jia-Ju Bai
@ 2021-04-18  5:54 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2021-04-18  5:54 UTC (permalink / raw)
  To: Jia-Ju Bai
  Cc: davem, kuba, lee.jones, colin.king, linux-wireless, netdev,
	linux-kernel, Jia-Ju Bai

Jia-Ju Bai <baijiaju1990@gmail.com> wrote:

> 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@tsinghua.edu.cn>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>

Someone needs to review this.

Patch set to Changes Requested.

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210305033115.6015-1-baijiaju1990@gmail.com/

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-18  5:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05  3:31 [PATCH] marvell: libertas_tf: fix error return code of if_usb_prog_firmware() Jia-Ju Bai
2021-04-18  5:54 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).