aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/mcg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/mlx4/mcg.c')
-rw-r--r--drivers/net/mlx4/mcg.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/net/mlx4/mcg.c b/drivers/net/mlx4/mcg.c
index a99e7729d333..57f7f1f0d4ec 100644
--- a/drivers/net/mlx4/mcg.c
+++ b/drivers/net/mlx4/mcg.c
@@ -190,10 +190,6 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
190 } 190 }
191 index += dev->caps.num_mgms; 191 index += dev->caps.num_mgms;
192 192
193 err = mlx4_READ_MCG(dev, index, mailbox);
194 if (err)
195 goto out;
196
197 memset(mgm, 0, sizeof *mgm); 193 memset(mgm, 0, sizeof *mgm);
198 memcpy(mgm->gid, gid, 16); 194 memcpy(mgm->gid, gid, 16);
199 } 195 }
@@ -301,12 +297,10 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
301 mgm->qp[loc] = mgm->qp[i - 1]; 297 mgm->qp[loc] = mgm->qp[i - 1];
302 mgm->qp[i - 1] = 0; 298 mgm->qp[i - 1] = 0;
303 299
304 err = mlx4_WRITE_MCG(dev, index, mailbox); 300 if (i != 1) {
305 if (err) 301 err = mlx4_WRITE_MCG(dev, index, mailbox);
306 goto out;
307
308 if (i != 1)
309 goto out; 302 goto out;
303 }
310 304
311 if (prev == -1) { 305 if (prev == -1) {
312 /* Remove entry from MGM */ 306 /* Remove entry from MGM */