1. 17 4月, 2008 2 次提交
    • R
      RDMA/nes: Use proper format and cast to print dma_addr_t · 71e0957c
      Roland Dreier 提交于
      On some platforms, eg sparc64, dma_addr_t is not the same size as a
      pointer, so printing dma_addr_t values by casting to void * and using
      a %p format generates warnings.  Fix this by casting to unsigned long
      and using %lx instead.  This fixes the warnings:
      
          drivers/infiniband/hw/nes/nes_verbs.c: In function 'nes_setup_virt_qp':
          drivers/infiniband/hw/nes/nes_verbs.c:1047: warning: cast to pointer from integer of different size
          drivers/infiniband/hw/nes/nes_verbs.c:1078: warning: cast to pointer from integer of different size
          drivers/infiniband/hw/nes/nes_verbs.c:1078: warning: cast to pointer from integer of different size
          drivers/infiniband/hw/nes/nes_verbs.c: In function 'nes_reg_user_mr':
          drivers/infiniband/hw/nes/nes_verbs.c:2657: warning: cast to pointer from integer of different size
      
      Reported by Andrew Morton <akpm@linux-foundation.org>.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      71e0957c
    • R
      RDMA/nes: Remove redundant NULL check in nes_unregister_ofa_device() · 5bd8341c
      Roland Dreier 提交于
      nes_unregister_ofa_device() dereferences the nesibdev pointer before
      testing if it's NULL.  Also, the test is doubly redundant because the
      only caller of nes_unregister_ofa_device() is nes_destroy_ofa_device(),
      which already tests if nesibdev is NULL.  Remove the unnecessary test.
      
      This was spotted by the Coverity checker (CID 2190).
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      5bd8341c
  2. 27 2月, 2008 1 次提交
  3. 26 2月, 2008 2 次提交
  4. 19 2月, 2008 1 次提交
    • R
      RDMA/nes: Fix possible array overrun · 51af33e8
      Roland Dreier 提交于
      In nes_create_qp(), the test
      
      	if (nesqp->mmap_sq_db_index > NES_MAX_USER_WQ_REGIONS) {
      
      is used to error out if the db_index is too large; however, if the
      test doesn't trigger, then the index is used as
      
      	nes_ucontext->mmap_nesqp[nesqp->mmap_sq_db_index] = nesqp;
      
      and mmap_nesqp is declared as
      
      	struct nes_qp      *mmap_nesqp[NES_MAX_USER_WQ_REGIONS];
      
      which leads to an array overrun if the index is exactly equal to
      NES_MAX_USER_WQ_REGIONS.  Fix this by bailing out if the index is
      greater than or equal to NES_MAX_USER_WQ_REGIONS.
      
      This was spotted by the Coverity checker (CID 2162).
      Acked-by: NGlenn Streiff <gstreiff@neteffect.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      51af33e8
  5. 05 2月, 2008 1 次提交