On Wed, May 22, 2019 at 03:42:47PM +0300, Kamal Heib wrote: > On Wed, 2019-05-22 at 09:15 -0300, Jason Gunthorpe wrote: > > On Wed, May 22, 2019 at 10:23:40AM +0300, Kamal Heib wrote: > > > A panic could occur when calling ib_device_release() and port_data > > > isn't initialized, To avoid that a check was added to verify that > > > port_data isn't NULL. > > > > This is a terrible commit message, describe the case that causes > > this. > > > > This happen if assign_name() return failure when called from > ib_register_device() - The following panic will happen and in every > function that touches the port_data's data members. Then this should be the commit message, with the oops. > > The check should be in ib_device_release(), not in the functions. > > > > Jason > > Why? Because if the device has not progressed to be setup enough we shouldn't be freeing things that aren't started yet. However, it is a bit weird because the cache_release was intended to not have dependencies - but the cache also can't be started until the port_data is setup The real problem is that we can't allocate the port data during ib_alloc_device.. Jason