aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParav Pandit2017-11-02 15:22:27 +0200
committerDoug Ledford2017-11-13 14:42:04 -0500
commit2e4c85c6edc80fa532b2c7e1eb3597ef4d4bbb8f (patch)
tree132a2b907b568c82d8ebb7da059e58069e3c07af
parent5f22a1d87c5315a98981ecf93cd8de226cffe6ca (diff)
IB/core: Avoid unnecessary return value check
Since there is nothing done with non zero return value, such check is avoided. Signed-off-by: Parav Pandit <parav@mellanox.com> Reviewed-by: Daniel Jurgens <danielj@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/core/security.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/infiniband/core/security.c b/drivers/infiniband/core/security.c
index 88bdafb297f5..455cba7f9640 100644
--- a/drivers/infiniband/core/security.c
+++ b/drivers/infiniband/core/security.c
@@ -692,20 +692,13 @@ void ib_mad_agent_security_cleanup(struct ib_mad_agent *agent)
int ib_mad_enforce_security(struct ib_mad_agent_private *map, u16 pkey_index)
{
- int ret;
-
if (map->agent.qp->qp_type == IB_QPT_SMI && !map->agent.smp_allowed)
return -EACCES;
- ret = ib_security_pkey_access(map->agent.device,
- map->agent.port_num,
- pkey_index,
- map->agent.security);
-
- if (ret)
- return ret;
-
- return 0;
+ return ib_security_pkey_access(map->agent.device,
+ map->agent.port_num,
+ pkey_index,
+ map->agent.security);
}
#endif /* CONFIG_SECURITY_INFINIBAND */