RE: [PATCH 1/5] IB/user_mad: Fix bug in ib_umad_remove_one when rdma_cap_ib_mad implementation changed

Weiny, Ira
2015-05-12T14:42:15Z

Fixed

Patch 5 need to be updated as well.

I'll send a new series today.

Ira

________________________________
From: Hefty, Sean
Sent: Monday, May 11, 2015 7:29:48 PM
To: Weiny, Ira; dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Weiny, Ira
Subject: RE: [PATCH 1/5] IB/user_mad: Fix bug in ib_umad_remove_one when rdma_cap_ib_mad implementation changed

> --- a/drivers/infiniband/core/user_mad.c
> +++ b/drivers/infiniband/core/user_mad.c
> @@ -1327,14 +1327,21 @@ free:
> static void ib_umad_remove_one(struct ib_device *device)
> {
> struct ib_umad_device *umad_dev = ib_get_client_data(device,
> &umad_client);
> - int i;
> + int s, e, i;
>
> if (!umad_dev)
> return;
>
> - for (i = 0; i <= umad_dev->end_port - umad_dev->start_port; ++i) {
> + if (device->node_type == RDMA_NODE_IB_SWITCH)
> + s = e = 0;
> + else {

Please use braces on both sides of the else if either side needs it. I.e. add braces to the if-part.