* [PATCH net-next] bnx2x: add missing parenthesis to prevent u32 overflow
@ 2012-04-04 12:27 Yuval Mintz
2012-04-04 22:04 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Yuval Mintz @ 2012-04-04 12:27 UTC (permalink / raw)
To: davem, netdev; +Cc: Dmitry Kravkov, Yuval Mintz, Eilon Greenstein
From: Dmitry Kravkov <dmitry@broadcom.com>
Commit b475d78 lacked two pairs of parenthesis, causing an overflow in the
congestion management.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
Hi Dave,
Please apply this patch to 'net-next'.
Thanks,
Dmitry
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h
index e6bb9f4..2b7a2bd 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h
@@ -409,7 +409,7 @@ static inline void bnx2x_init_min(const struct cmng_init_input *input_data,
*/
vdata->vnic_min_rate[vnic].vn_credit_delta =
(u32)input_data->vnic_min_rate[vnic] * 100 *
- T_FAIR_COEF / (8 * 100 * vnicWeightSum);
+ (T_FAIR_COEF / (8 * 100 * vnicWeightSum));
if (vdata->vnic_min_rate[vnic].vn_credit_delta <
pdata->fair_vars.fair_threshold +
MIN_ABOVE_THRESH) {
@@ -446,7 +446,7 @@ static inline void bnx2x_init_fw_wrr(const struct cmng_init_input *input_data,
*/
ccd[cos] =
(u32)input_data->cos_min_rate[cos] * 100 *
- T_FAIR_COEF / (8 * 100 * cosWeightSum);
+ (T_FAIR_COEF / (8 * 100 * cosWeightSum));
if (ccd[cos] < pdata->fair_vars.fair_threshold
+ MIN_ABOVE_THRESH) {
ccd[cos] =
--
1.7.9.rc2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] bnx2x: add missing parenthesis to prevent u32 overflow
2012-04-04 12:27 [PATCH net-next] bnx2x: add missing parenthesis to prevent u32 overflow Yuval Mintz
@ 2012-04-04 22:04 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-04-04 22:04 UTC (permalink / raw)
To: yuvalmin; +Cc: netdev, dmitry, eilong
From: "Yuval Mintz" <yuvalmin@broadcom.com>
Date: Wed, 4 Apr 2012 15:27:42 +0300
> From: Dmitry Kravkov <dmitry@broadcom.com>
>
> Commit b475d78 lacked two pairs of parenthesis, causing an overflow in the
> congestion management.
>
> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-04 22:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-04 12:27 [PATCH net-next] bnx2x: add missing parenthesis to prevent u32 overflow Yuval Mintz
2012-04-04 22:04 ` David Miller
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).