On Sun, May 05, 2019 at 07:33:20PM +0300, Leon Romanovsky wrote: > From: Leon Romanovsky <leonro@xxxxxxxxxxxx> > > When the refcount is 0 the device is invisible to netlink. However > in the patch below the refcount = 1 was moved to after the device_add(). > This creates a race where userspace can issue a netlink query after the > device_add() event and not see the device as visible. > > Ensure that no uevent is fired before device is fully registered. > > Fixes: d79af7242bb2 ("RDMA/device: Expose ib_device_try_get(()") > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> > --- > Changelog > v0 -> v1 > * Fix comment as suggested by Parav. > --- > drivers/infiniband/core/device.c | 9 +++++++++ > 1 file changed, 9 insertions(+) While I don't particularly like this approach, it seems like all we will be able to manage for this merge window, so applied to for-next Thanks, Jason