nvme-fabrics: don't check for non-NULL module in nvmf_register_transport

THIS_MODULE evaluates to NULL when used from code built into the kernel,
thus breaking built-in transport modules.  Remove the bogus check.

Fixes: 0de5cd36 ("nvme-fabrics: protect against module unload during create_ctrl")
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Sagi Grimberg <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Keith Busch <[email protected]>
This commit is contained in:
Christoph Hellwig 2018-02-22 07:24:08 -08:00 • committed by Keith Busch
commit 5a1e595333

View file

@ -493,7 +493,7 @@ EXPORT_SYMBOL_GPL(nvmf_should_reconnect);
*/
int nvmf_register_transport(struct nvmf_transport_ops *ops)
{
if (!ops->create_ctrl || !ops->module)
if (!ops->create_ctrl)
return -EINVAL;
down_write(&nvmf_transports_rwsem);