[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+ASDXMYbP3jQPeOpDDktHgp4X81AH41cgiLFgz-YHVPyZO1sw@mail.gmail.com>
Date: Wed, 27 Oct 2021 11:22:39 -0700
From: Brian Norris <briannorris@...omium.org>
To: Johan Hovold <johan@...nel.org>
Cc: Kalle Valo <kvalo@...eaurora.org>,
Amitkumar Karwar <amitkarwar@...il.com>,
Ganapathi Bhat <ganapathi017@...il.com>,
Sharvari Harisangam <sharvari.harisangam@....com>,
Xinming Hu <huxinming820@...il.com>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org, Amitkumar Karwar <akarwar@...vell.com>
Subject: Re: [PATCH v2 3/3] mwifiex: fix division by zero in fw download path
On Wed, Oct 27, 2021 at 1:12 AM Johan Hovold <johan@...nel.org> wrote:
> --- a/drivers/net/wireless/marvell/mwifiex/usb.c
> +++ b/drivers/net/wireless/marvell/mwifiex/usb.c
> @@ -505,6 +505,22 @@ static int mwifiex_usb_probe(struct usb_interface *intf,
> }
> }
>
> + switch (card->usb_boot_state) {
> + case USB8XXX_FW_DNLD:
> + /* Reject broken descriptors. */
> + if (!card->rx_cmd_ep || !card->tx_cmd_ep)
> + return -ENODEV;
^^ These two conditions are applicable to USB8XXX_FW_READY too, right?
> + if (card->bulk_out_maxpktsize == 0)
> + return -ENODEV;
> + break;
> + case USB8XXX_FW_READY:
> + /* Assume the driver can handle missing endpoints for now. */
> + break;
> + default:
> + WARN_ON(1);
> + return -ENODEV;
> + }
> +
Anyway, looks pretty good, thanks:
Reviewed-by: Brian Norris <briannorris@...omium.org>
Powered by blists - more mailing lists