If VOP_ADD_WRITECOUNT() or adv locking failed, so VOP_CLOSE() needs to be called, we cannot use fp fo_close() when there is no fp. This occurs when e.g. kernel code directly calls vn_open() instead of the open(2) syscall.
In this case, VOP_CLOSE() can be called directly, after possible lock upgrade.
Reported by: email@example.com