mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
RDMA/cma: Fix error flow in default_roce_mode_store
[ Upstream commit7c7b3e5d9a
] In default_roce_mode_store(), we took a reference to cma_dev, but didn't return it with cma_dev_put in the error flow. Fixes:1c15b4f2a4
("RDMA/core: Modify enum ib_gid_type and enum rdma_network_type") Link: https://lore.kernel.org/r/20210113130214.562108-1-leon@kernel.org Signed-off-by: Neta Ostrovsky <netao@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
56c1362981
commit
2cd90971a2
1 changed files with 3 additions and 1 deletions
|
@ -131,8 +131,10 @@ static ssize_t default_roce_mode_store(struct config_item *item,
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
gid_type = ib_cache_gid_parse_type_str(buf);
|
gid_type = ib_cache_gid_parse_type_str(buf);
|
||||||
if (gid_type < 0)
|
if (gid_type < 0) {
|
||||||
|
cma_configfs_params_put(cma_dev);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
ret = cma_set_default_gid_type(cma_dev, group->port_num, gid_type);
|
ret = cma_set_default_gid_type(cma_dev, group->port_num, gid_type);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue