OSDN Git Service

RDMA/core: Properly return the error code of rdma_set_src_addr_rcu
authorYueHaibing <yuehaibing@huawei.com>
Wed, 19 Sep 2018 12:28:38 +0000 (20:28 +0800)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 19 Sep 2018 16:12:44 +0000 (10:12 -0600)
commit0965cc953a235196b8d6ef0cba45ecb5c355194f
treed2b45ba1edf001b7b93aae312d60bf0b1098d109
parent802fa45cd320de319e86c93bca72abec028ba059
RDMA/core: Properly return the error code of rdma_set_src_addr_rcu

rdma_set_src_addr_rcu should check copy_src_l2_addr fails, rather than
always return 0. Also copy_src_l2_addr should return 'ret' as its return
value when rdma_translate_ip fails.

Fixes: c31d4b2ddf07 ("RDMA/core: Protect against changing dst->dev during destination resolve")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/addr.c