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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 18 May 2017 10:03:17 -0500
From:   Chien Tin Tung <chien.tin.tung@...el.com>
To:     Leon Romanovsky <leon@...nel.org>
Cc:     "Gustavo A. R. Silva" <garsilva@...eddedor.com>,
        Faisal Latif <faisal.latif@...el.com>,
        Shiraz Saleem <shiraz.saleem@...el.com>,
        Doug Ledford <dledford@...hat.com>,
        Sean Hefty <sean.hefty@...el.com>,
        Hal Rosenstock <hal.rosenstock@...il.com>,
        linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [infiniband-hw-i40iw] question about identical code for
 different branches

 Thu, May 18, 2017 at 08:00:29AM +0300, Leon Romanovsky wrote:
> On Wed, May 17, 2017 at 05:06:54PM -0500, Gustavo A. R. Silva wrote:
> >
> > Hello everybody,
> >
> > While looking into Coverity ID 1362263 I ran into the following piece of
> > code at drivers/infiniband/hw/i40iw/i40iw_virtchnl.c:445:
> >
> > 445        if (vchnl_msg->iw_op_code == I40IW_VCHNL_OP_GET_VER) {
> > 446                if (vchnl_msg->iw_op_ver != I40IW_VCHNL_OP_GET_VER_V0)
> > 447                        vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg);
> > 448                else
> > 449                        vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg);
> > 450                return I40IW_SUCCESS;
> > 451        }
> >
> > The issue is that lines of code 447 and 449 are identical for different
> > branches.
> >
> > My question here is if one of the branches should be modified, or the entire
> > _if_ statement replaced?
> >
> > Maybe a patch like the following could be applied:
> 
> It looks like that you can replace I40IW_VCHNL_OP_GET_VER_V0 with
> I40IW_VCHNL_OP_GET_VER and get rid of all places with
> I40IW_VCHNL_OP_GET_VER_V0.

No. I40IW_VCHNL_OP_GET_VER is iw_op_code and I40IW_VCHNL_OP_GET_VER_V0 is
iw_op_ver two different things.

Chien

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ