[PATCH 1/3] target: configfs: preserve the error from fabric_make_np()

From: shao.mingyin

Date: Sun Nov 08 2026 - 22:41:05 EST


From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>

target_fabric_make_np() replaces every error pointer returned by the
fabric callback with -EINVAL. Return the original error.

Fixes: c66ac9db8d4ad ("[SCSI] target: Add LIO target core v4.0.0-rc6")
Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
---
diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c
index ab8f81650710..5bd2a042aac9 100644
--- a/drivers/target/target_core_fabric_configfs.c
+++ b/drivers/target/target_core_fabric_configfs.c
@@ -479,7 +479,9 @@ static struct config_group *target_fabric_make_np(
}

se_tpg_np = tf->tf_ops->fabric_make_np(se_tpg, group, name);
- if (!se_tpg_np || IS_ERR(se_tpg_np))
+ if (IS_ERR(se_tpg_np))
+ return ERR_PTR(PTR_ERR(se_tpg_np));
+ if (!se_tpg_np)
return ERR_PTR(-EINVAL);

se_tpg_np->tpg_np_parent = se_tpg;