Commit 4bd5d43
authored
Fix: prevent divide-by-zero in mt_srss_init (#1298)
Add validation to check if nb_rx_q is zero before it can be used in
division. If nb_rx_q is zero, return -EINVAL with error message.
This prevents the divide-by-zero at line 459 where srss->nb_rx_q /
srss->schs_cnt could fail if schs_cnt becomes zero (which happens when
nb_rx_q is zero).1 parent 5770478 commit 4bd5d43
File tree
1 file changed
+7
-0
lines changed- lib/src/datapath
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
457 | 464 | | |
458 | 465 | | |
459 | 466 | | |
| |||
0 commit comments