re: bnx2x: Added EEE support

4 messages, 2 authors, 2012-10-22 · open the first message on its own page

re: bnx2x: Added EEE support

From: Dan Carpenter <hidden>
Date: 2012-06-08 13:09:32

Hello Yuval Mintz,

The patch c8c60d88c59c: "bnx2x: Added EEE support" from Jun 6, 2012, 
leads to the following warning:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:10121 
bnx2x_848x3_config_init()
	 error: buffer overflow 'params->req_duplex' 2 <= 4

drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
 10032          actual_phy_selection = bnx2x_phy_selection(params);
 10033  
 10034          switch (actual_phy_selection) {
 10035          case PORT_HW_CFG_PHY_SELECTION_HARDWARE_DEFAULT:
 10036                  /* Do nothing. Essentially this is like the priority copper */
 10037                  break;
 10038          case PORT_HW_CFG_PHY_SELECTION_FIRST_PHY_PRIORITY:
 10039                  val |= MDIO_CTL_REG_84823_MEDIA_PRIORITY_COPPER;
 10040                  break;
 10041          case PORT_HW_CFG_PHY_SELECTION_SECOND_PHY_PRIORITY:
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
We assume "actual_phy_selection" can be 4 here.

 10042                  val |= MDIO_CTL_REG_84823_MEDIA_PRIORITY_FIBER;
 10043                  break;

[snip]

 10121                  if ((params->req_duplex[actual_phy_selection] == DUPLEX_FULL) &&
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This array only has 2 elements so 4 is beyond the end.

 10122                      (params->eee_mode & EEE_MODE_ADV_LPI) &&
 10123                      (bnx2x_eee_calc_timer(params) ||
 10124                       !(params->eee_mode & EEE_MODE_ENABLE_LPI)))
 10125                          rc = bnx2x_8483x_enable_eee(phy, params, vars);
 10126                  else

regards,
dan carpenter

RE: bnx2x: Added EEE support

From: Yuval Mintz <hidden>
Date: 2012-06-10 07:47:54

The patch c8c60d88c59c: "bnx2x: Added EEE support" from Jun 6, 2012,
leads to the following warning:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:10121
bnx2x_848x3_config_init()
	 error: buffer overflow 'params->req_duplex' 2 <= 4
Hi Dan,

You are right - this is indeed an error, although one that shouldn't
affect any existing bnx2x chip supporting EEE.

I'll send a patch correcting it soon.

Thanks,
Yuval

Re: bnx2x: Added EEE support

From: Dan Carpenter <hidden>
Date: 2012-10-22 12:07:02

On Sun, Jun 10, 2012 at 07:47:13AM +0000, Yuval Mintz wrote:
quoted
The patch c8c60d88c59c: "bnx2x: Added EEE support" from Jun 6, 2012,
leads to the following warning:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:10121
bnx2x_848x3_config_init()
	 error: buffer overflow 'params->req_duplex' 2 <= 4
Hi Dan,

You are right - this is indeed an error, although one that shouldn't
affect any existing bnx2x chip supporting EEE.

I'll send a patch correcting it soon.
What happened with this?

regards,
dan carpenter

Re: bnx2x: Added EEE support

From: Yuval Mintz <hidden>
Date: 2012-10-22 12:17:25

On Sun, Jun 10, 2012 at 07:47:13AM +0000, Yuval Mintz wrote:
quoted
quoted
The patch c8c60d88c59c: "bnx2x: Added EEE support" from Jun 6, 2012,
leads to the following warning:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:10121
bnx2x_848x3_config_init()
	 error: buffer overflow 'params->req_duplex' 2 <= 4
Hi Dan,

You are right - this is indeed an error, although one that shouldn't
affect any existing bnx2x chip supporting EEE.

I'll send a patch correcting it soon.
What happened with this?

regards,
dan carpenter
The patch will be sent upstream in the next couple of days.

Thanks,
Yuval
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help