Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/mlx4: Handle return codes in mlx4_qp_attach_common

Both new_steering_entry() and existing_steering_entry() return values
based on their success or failure, but currently they fall through
silently. This can make troubleshooting difficult, as we were unable
to tell which one of these two functions returned errors or
specifically what code was returned. This patch remedies that
situation by passing the return codes to err, which is returned by
mlx4_qp_attach_common() itself.

This also addresses a leak in the call to mlx4_bitmap_free() as well.

Signed-off-by: Robb Manes <rmanes@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Robb Manes and committed by
David S. Miller
23860f10 c047a1f9

+4 -3
+4 -3
drivers/net/ethernet/mellanox/mlx4/mcg.c
··· 1184 1184 if (prot == MLX4_PROT_ETH) { 1185 1185 /* manage the steering entry for promisc mode */ 1186 1186 if (new_entry) 1187 - new_steering_entry(dev, port, steer, index, qp->qpn); 1187 + err = new_steering_entry(dev, port, steer, 1188 + index, qp->qpn); 1188 1189 else 1189 - existing_steering_entry(dev, port, steer, 1190 - index, qp->qpn); 1190 + err = existing_steering_entry(dev, port, steer, 1191 + index, qp->qpn); 1191 1192 } 1192 1193 if (err && link && index != -1) { 1193 1194 if (index < dev->caps.num_mgms)