]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
IB/core: type promotion bug in rdma_rw_init_one_mr()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 4 Jul 2018 09:32:12 +0000 (12:32 +0300)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:50:42 +0000 (19:50 -0600)
commit5988be49b29bfe78b253cbeb2a9d87c0ebd6f406
tree48b0dbc7314352ca4898f3cdb09bfcb5a106d241
parent7b8bd9662c64b24a873e307774ac8e6b976ff5bf
IB/core: type promotion bug in rdma_rw_init_one_mr()

BugLink: https://bugs.launchpad.net/bugs/1836287
[ Upstream commit c2d7c8ff89b22ddefb1ac2986c0d48444a667689 ]

"nents" is an unsigned int, so if ib_map_mr_sg() returns a negative
error code then it's type promoted to a high unsigned int which is
treated as success.

Fixes: a060b5629ab0 ("IB/core: generic RDMA READ/WRITE API")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/infiniband/core/rw.c