lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170217155934.GE4108@mwanda>
Date:   Fri, 17 Feb 2017 18:59:34 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Colin King <colin.king@...onical.com>
Cc:     Selvin Xavier <selvin.xavier@...adcom.com>,
        Devesh Sharma <devesh.sharma@...adcom.com>,
        Somnath Kotur <somnath.kotur@...adcom.com>,
        Sriharsha Basavapatna <sriharsha.basavapatna@...adcom.com>,
        Doug Ledford <dledford@...hat.com>,
        Sean Hefty <sean.hefty@...el.com>,
        Hal Rosenstock <hal.rosenstock@...il.com>,
        linux-rdma@...r.kernel.org, kernel-janitors@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] RDMA/bnxt_re: remove redundant initialization of rc to
 zero

drivers/infiniband/hw/bnxt_re/ib_verbs.c
  2817  int bnxt_re_dereg_mr(struct ib_mr *ib_mr)
  2818  {
  2819          struct bnxt_re_mr *mr = container_of(ib_mr, struct bnxt_re_mr, ib_mr);
  2820          struct bnxt_re_dev *rdev = mr->rdev;
  2821          int rc = 0;

It's weird that it would complain about this because initializing
variables to bogus values is a prefered style for some people.  It's
bad style obviously, yes, but it's common and it seems like it would
lead to a lot of false postives.

  2822  
  2823          if (mr->npages && mr->pages) {
  2824                  rc = bnxt_qplib_free_fast_reg_page_list(&rdev->qplib_res,
  2825                                                          &mr->qplib_frpl);

And then it doesn't complain about this one which seems like a legit
bug.

  2826                  kfree(mr->pages);
  2827                  mr->npages = 0;
  2828                  mr->pages = NULL;
  2829          }
  2830          rc = bnxt_qplib_free_mrw(&rdev->qplib_res, &mr->qplib_mr);
  2831  
  2832          if (!IS_ERR(mr->ib_umem) && mr->ib_umem)
  2833                  ib_umem_release(mr->ib_umem);
  2834  
  2835          kfree(mr);
  2836          atomic_dec(&rdev->mr_count);
  2837          return rc;
  2838  }

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ