> + dev = kmalloc(sizeof *dev + device->phys_port_cnt * sizeof *port, > + GFP_KERNEL); > + if (!dev) > + return; > + > + for (i = 1; i <= device->phys_port_cnt; i++) { Seems like this is implicitly assuming that the IB device is a CA. Maybe we should give up the ghost and stop trying to support IB switches? - R.