returning NULL means you are fairly welcoming the supplied dentry and attach it to your inode.
returning a dentry means it is a dentry which filesystem figured out was already associated with its inode. When can this happen? lookup process builds up a chain from parent to child dentry. In case of NFS export, lookup is done from file handle which can result in dentries which are disconnected from their parent, but are associated with inode. So, when you return such dentries from this operation, VFS will change their disconnected status.