public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] IB/mlx5: Respect mlx5_core reserved GIDs
@ 2017-07-06  9:39 Dan Carpenter
  2017-07-06 10:38 ` Leon Romanovsky
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Carpenter @ 2017-07-06  9:39 UTC (permalink / raw)
  To: ilant-VPRAkNaXOzVWk0Htik3J/w; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hello Ilan Tayari,

This is a semi-automatic email about new static checker warnings.

The patch 095b0927f0ce: "IB/mlx5: Respect mlx5_core reserved GIDs"
from May 14, 2017, leads to the following Smatch complaint:

drivers/infiniband/hw/mlx5/main.c:327 set_roce_addr()
	 error: we previously assumed 'gid' could be null (see line 300)

drivers/infiniband/hw/mlx5/main.c
   299	
   300		if (gid) {
                    ^^^
Before we used to return early if gid was NULL.

   301			gid_type = attr->gid_type;
   302			ether_addr_copy(mac, attr->ndev->dev_addr);
   303	
   304			if (is_vlan_dev(attr->ndev)) {
   305				vlan = true;
   306				vlan_id = vlan_dev_vlan_id(attr->ndev);
   307			}
   308		}
   309	
   310		switch (gid_type) {
   311		case IB_GID_TYPE_IB:
   312			roce_version = MLX5_ROCE_VERSION_1;
   313			break;
   314		case IB_GID_TYPE_ROCE_UDP_ENCAP:
   315			roce_version = MLX5_ROCE_VERSION_2;
   316			if (ipv6_addr_v4mapped((void *)gid))
   317				roce_l3_type = MLX5_ROCE_L3_TYPE_IPV4;
   318			else
   319				roce_l3_type = MLX5_ROCE_L3_TYPE_IPV6;
   320			break;
   321	
   322		default:
   323			mlx5_ib_warn(dev, "Unexpected GID type %u\n", gid_type);
   324		}
   325	
   326		return mlx5_core_roce_gid_set(dev->mdev, index, roce_version,
   327					      roce_l3_type, gid->raw, mac, vlan,
                                                            ^^^^^^^^
Dereference.

   328					      vlan_id);
   329	}

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-07-17  9:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-06  9:39 [bug report] IB/mlx5: Respect mlx5_core reserved GIDs Dan Carpenter
2017-07-06 10:38 ` Leon Romanovsky
     [not found]   ` <20170706103811.GY1528-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-07-06 11:10     ` Dan Carpenter
2017-07-06 11:24       ` Ilan Tayari
     [not found]         ` <AM4PR0501MB194030AAB6D5D15585C416AADBD50-dp/nxUn679gfNUYDR5dMTsDSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-07-06 11:44           ` Dan Carpenter
2017-07-06 12:04             ` Leon Romanovsky
     [not found]               ` <20170706120407.GA1528-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-07-06 12:09                 ` Ilan Tayari
2017-07-06 11:47           ` Leon Romanovsky
     [not found]             ` <20170706114733.GZ1528-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-07-06 12:16               ` Dan Carpenter
2017-07-17  9:19                 ` Ilan Tayari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox