Only NULL check the VNET pointer when VIMAGE is enabled in ibcore.

Else a NULL VNET pointer should be ignored. This fixes address resolving
when VIMAGE is disabled.

MFC after:		3 days
Sponsored by:		Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2018-07-31 11:23:44 +00:00
parent 51e08d53ae
commit fb11674d30
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336964

View File

@ -182,7 +182,11 @@ struct ib_sa_path_rec {
static inline struct net_device *ib_get_ndev_from_path(struct ib_sa_path_rec *rec)
{
return rec->net ? dev_get_by_index(rec->net, rec->ifindex) : NULL;
#ifdef VIMAGE
if (rec->net == NULL)
return NULL;
#endif
return dev_get_by_index(rec->net, rec->ifindex);
}
#define IB_SA_MCMEMBER_REC_MGID IB_SA_COMP_MASK( 0)