RDMA/uverbs: Fix validity check for modify QP
authorMajd Dibbiny <majd@mellanox.com>
Tue, 18 Sep 2018 07:51:37 +0000 (10:51 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 20 Sep 2018 22:47:30 +0000 (16:47 -0600)
commit4eeed3686981ff887bbdd7254139e2eca276534c
tree40957a7874ee1c9ad9b124d7ba630d4bdcc16e4b
parentee92efe41cf358f4b99e73509f2bfd4733609f26
RDMA/uverbs: Fix validity check for modify QP

Uverbs shouldn't enforce QP state in the command unless the user set the QP
state bit in the attribute mask.

In addition, only copy qp attr fields which have the corresponding bit set
in the attribute mask over to the internal attr structure.

Fixes: 88de869bbe4f ("RDMA/uverbs: Ensure validity of current QP state value")
Fixes: bc38a6abdd5a ("[PATCH] IB uverbs: core implementation")
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/uverbs_cmd.c