Re: [PATCH v2 3/3] mwifiex: fix division by zero in fw download path

From
Brian Norris <briannorris@chromium.org>
Date
2021-10-27 18:23:04
Also in
linux-usb, lkml, netdev, stable
Reply to
Johan Hovold, 2021-10-27
On Wed, Oct 27, 2021 at 1:12 AM Johan Hovold [off-list ref] wrote:
quoted hunk ↗ jump to hunk
--- 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?
quoted hunk ↗ jump to hunk
+               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@chromium.org>
Thread (8 messages) 8 messages, 3 authors, last reply 2021-10-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help