]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
RDMA/core: Fix use of logical OR in get_new_pps
authorNathan Chancellor <natechancellor@gmail.com>
Mon, 17 Feb 2020 20:43:18 +0000 (13:43 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 7 Apr 2020 08:51:12 +0000 (10:51 +0200)
commit2322531d8889e1c61b33bfeb60fe4553b8af7238
tree1a17f06a50618c94ab650f42fa8b8e88b932cc16
parentc008cca20d3f64889ad38132e72d560cf3e4f52f
RDMA/core: Fix use of logical OR in get_new_pps

BugLink: https://bugs.launchpad.net/bugs/1868623
[ Upstream commit 4ca501d6aaf21de31541deac35128bbea8427aa6 ]

Clang warns:

../drivers/infiniband/core/security.c:351:41: warning: converting the
enum constant to a boolean [-Wint-in-bool-context]
        if (!(qp_attr_mask & (IB_QP_PKEY_INDEX || IB_QP_PORT)) && qp_pps) {
                                               ^
1 warning generated.

A bitwise OR should have been used instead.

Fixes: 1dd017882e01 ("RDMA/core: Fix protection fault in get_pkey_idx_qp_list")
Link: https://lore.kernel.org/r/20200217204318.13609-1-natechancellor@gmail.com
Link: https://github.com/ClangBuiltLinux/linux/issues/889
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/infiniband/core/security.c