[bug report] forever loop in ksocknal_push()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Peng Tao,

The patch d7e09d0397e8: "staging: add Lustre file system client
support" from May 2, 2013, leads to the following static checker
warning:

	drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:1904 ksocknal_push()
	info: ignoring unreachable code.

drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
  1904          for (i = 0; i < ksocknal_data.ksnd_peer_hash_size; i++) {
                                                                   ^^^
Not reached.

  1905                  for (j = 0; ; j++) {
                             ^^^^^^^^^^^^
This loop is a forever loop.  No break statements or exit conditions. I
don't know how to fix this.

  1906                          read_lock(&ksocknal_data.ksnd_global_lock);
  1907  
  1908                          index = 0;
  1909                          peer = NULL;
  1910  
  1911                          list_for_each (tmp, &ksocknal_data.ksnd_peers[i]) {
  1912                                  peer = list_entry(tmp, ksock_peer_t,
  1913                                                        ksnp_list);
  1914  
  1915                                  if (!((id.nid == LNET_NID_ANY ||
  1916                                         id.nid == peer->ksnp_id.nid) &&
  1917                                        (id.pid == LNET_PID_ANY ||
  1918                                         id.pid == peer->ksnp_id.pid))) {
  1919                                          peer = NULL;
  1920                                          continue;
  1921                                  }
  1922  
  1923                                  if (index++ == j) {
  1924                                          ksocknal_peer_addref(peer);
  1925                                          break;
  1926                                  }
  1927                          }
  1928  
  1929                          read_unlock(&ksocknal_data.ksnd_global_lock);
  1930  
  1931                          if (peer != NULL) {
  1932                                  rc = 0;
  1933                                  ksocknal_push_peer (peer);
  1934                                  ksocknal_peer_decref(peer);
  1935                          }
  1936                  }
  1937  
  1938          }

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux