On Sun, Oct 21, 2018 at 03:49:53PM +0300, Kamal Heib wrote: > diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c > index 723d3daf2eba..7c79e5ce8c39 100644 > +++ b/drivers/infiniband/sw/rdmavt/vt.c > @@ -395,8 +395,8 @@ enum { > static inline int check_driver_override(struct rvt_dev_info *rdi, > size_t offset, void *func) > { > - if (!*(void **)((void *)&rdi->ibdev + offset)) { > - *(void **)((void *)&rdi->ibdev + offset) = func; > + if (!*(void **)((void *)&rdi->ibdev.ops + offset)) { > + *(void **)((void *)&rdi->ibdev.ops + offset) = func; > return 0; > } > > @@ -417,7 +417,7 @@ static noinline int check_support(struct rvt_dev_info *rdi, int verb) > break; > > case QUERY_DEVICE: > - check_driver_override(rdi, offsetof(struct ib_device, > + check_driver_override(rdi, offsetof(struct ib_device_ops, > query_device), > rvt_query_device); Yikes, this is a totally grotesque thing in rdmavt. You should fix it as well.. Something like: if (!rdi->ibdev.ops.create_qp) if (!rdi->driver_f.qp_priv_alloc || !rdi->driver_f.qp_priv_free || !rdi->driver_f.notify_qp_reset || !rdi->driver_f.flush_qp_waiters || !rdi->driver_f.stop_send_queue || !rdi->driver_f.quiesce_qp) return -EINVAL; [.. for each of those cases, no switch or for loop, what a bad idea ..] /* If ops.X is NULL then use the rdmavt version, otherwise use the driver overridden version. */ struct ib_device_ops ops = {}; set_device_ops(&ops, &rdmavt_ops); set_device_ops(&ops, &rdi->ibdev.ops); ib_set_device_ops(&rdi->ibdev, &ops); Jason