re: fjes: update_zone_task

2 messages, 2 authors, 2015-09-15 · open the first message on its own page

re: fjes: update_zone_task

From: Dan Carpenter <hidden>
Date: 2015-09-14 01:32:20

Hello Taku Izumi,

The patch 785f28e061a8: "fjes: update_zone_task" from Aug 21, 2015,
leads to the following static checker warning:

	drivers/net/fjes/fjes_hw.c:1016 fjes_hw_update_zone_task()
	warn: potential off by one 'info[]' limit 'hw->max_epid'

drivers/net/fjes/fjes_hw.c
   963          case 0:
   964  
   965                  for (epidx = 0; epidx < hw->max_epid; epidx++) {
   966                          if (epidx == hw->my_epid) {
   967                                  hw->ep_shm_info[epidx].es_status =
   968                                          info[epidx].es_status;
   969                                  hw->ep_shm_info[epidx].zone =
   970                                          info[epidx].zone;
   971                                  continue;
   972                          }
   973  
   974                          pstatus = fjes_hw_get_partner_ep_status(hw, epidx);
   975                          switch (pstatus) {
   976                          case EP_PARTNER_UNSHARE:
   977                          default:
   978                                  if ((info[epidx].zone !=
   979                                          FJES_ZONING_ZONE_TYPE_NONE) &&
   980                                      (info[epidx].es_status ==
   981                                          FJES_ZONING_STATUS_ENABLE) &&
   982                                      (info[epidx].zone ==
   983                                          info[hw->my_epid].zone))
   984                                          set_bit(epidx, &share_bit);
   985                                  else
   986                                          set_bit(epidx, &unshare_bit);
   987                                  break;
   988  
   989                          case EP_PARTNER_COMPLETE:
   990                          case EP_PARTNER_WAITING:
   991                                  if ((info[epidx].zone ==
   992                                          FJES_ZONING_ZONE_TYPE_NONE) ||
   993                                      (info[epidx].es_status !=

41 more lines

RE: fjes: update_zone_task

From: Izumi, Taku <hidden>
Date: 2015-09-15 02:07:56

Dear Dan,

  Thanks for pointing!
  I'll check that soon.

  Sincerely,
  Taku Izumi
-----Original Message-----
From: Dan Carpenter [mailto:<redacted>]
Sent: Monday, September 14, 2015 10:32 AM
To: Izumi, Taku/泉 拓
Cc: <redacted>
Subject: re: fjes: update_zone_task

Hello Taku Izumi,

The patch 785f28e061a8: "fjes: update_zone_task" from Aug 21, 2015,
leads to the following static checker warning:

	drivers/net/fjes/fjes_hw.c:1016 fjes_hw_update_zone_task()
	warn: potential off by one 'info[]' limit 'hw->max_epid'

drivers/net/fjes/fjes_hw.c
   963          case 0:
   964
   965                  for (epidx = 0; epidx < hw->max_epid; epidx++) {
   966                          if (epidx == hw->my_epid) {
   967                                  hw->ep_shm_info[epidx].es_status =
   968                                          info[epidx].es_status;
   969                                  hw->ep_shm_info[epidx].zone =
   970                                          info[epidx].zone;
   971                                  continue;
   972                          }
   973
   974                          pstatus = fjes_hw_get_partner_ep_status(hw, epidx);
   975                          switch (pstatus) {
   976                          case EP_PARTNER_UNSHARE:
   977                          default:
   978                                  if ((info[epidx].zone !=
   979                                          FJES_ZONING_ZONE_TYPE_NONE) &&
   980                                      (info[epidx].es_status ==
   981                                          FJES_ZONING_STATUS_ENABLE) &&
   982                                      (info[epidx].zone ==
   983                                          info[hw->my_epid].zone))
   984                                          set_bit(epidx, &share_bit);
   985                                  else
   986                                          set_bit(epidx, &unshare_bit);

48 more quoted lines

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