net/mlx4_core: Avoid returning success in case of an error flow
The err variable wasn't set with the correct error value in some cases.
Fixes: 47605df953
('mlx4: Modify proxy/tunnel QP mechanism [..]')
Signed-off-by: Noa Osherovich <noaos@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f5adbfee72
commit
d49c2197fd
@ -892,9 +892,10 @@ static int mlx4_slave_cap(struct mlx4_dev *dev)
|
|||||||
dev->caps.qp1_proxy[i - 1] = func_cap.qp1_proxy_qpn;
|
dev->caps.qp1_proxy[i - 1] = func_cap.qp1_proxy_qpn;
|
||||||
dev->caps.port_mask[i] = dev->caps.port_type[i];
|
dev->caps.port_mask[i] = dev->caps.port_type[i];
|
||||||
dev->caps.phys_port_id[i] = func_cap.phys_port_id;
|
dev->caps.phys_port_id[i] = func_cap.phys_port_id;
|
||||||
if (mlx4_get_slave_pkey_gid_tbl_len(dev, i,
|
err = mlx4_get_slave_pkey_gid_tbl_len(dev, i,
|
||||||
&dev->caps.gid_table_len[i],
|
&dev->caps.gid_table_len[i],
|
||||||
&dev->caps.pkey_table_len[i]))
|
&dev->caps.pkey_table_len[i]);
|
||||||
|
if (err)
|
||||||
goto err_mem;
|
goto err_mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -906,6 +907,7 @@ static int mlx4_slave_cap(struct mlx4_dev *dev)
|
|||||||
dev->caps.uar_page_size * dev->caps.num_uars,
|
dev->caps.uar_page_size * dev->caps.num_uars,
|
||||||
(unsigned long long)
|
(unsigned long long)
|
||||||
pci_resource_len(dev->persist->pdev, 2));
|
pci_resource_len(dev->persist->pdev, 2));
|
||||||
|
err = -ENOMEM;
|
||||||
goto err_mem;
|
goto err_mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user