diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vendorcode/cavium/bdk/libbdk-hal/bdk-usb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vendorcode/cavium/bdk/libbdk-hal/bdk-usb.c b/src/vendorcode/cavium/bdk/libbdk-hal/bdk-usb.c index eb2a85fa0d..83ce563601 100644 --- a/src/vendorcode/cavium/bdk/libbdk-hal/bdk-usb.c +++ b/src/vendorcode/cavium/bdk/libbdk-hal/bdk-usb.c @@ -369,7 +369,9 @@ int bdk_usb_initialize(bdk_node_t node, int usb_port, bdk_usb_clock_t clock_type uint64_t fr_div; if (divider < 5) fr_div = divider * 2; else fr_div = 8 * (divider - 3); - uint64_t freq = (typeof(freq)) (sclk_rate / fr_div); + uint64_t freq = 0; + if (fr_div > 0) + freq = (typeof(freq)) (sclk_rate / fr_div); const char *token; if (freq < 62500000ULL) token = "???Low"; else if (freq < 90000000ULL) token = "USB2"; |