[PATCH 2/2] target: core: drop the dead kmap_local_page() NULL check

From: shao.mingyin

Date: Thu Nov 05 2026 - 06:37:07 EST


From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>

kmap_local_page() never returns NULL; drop the wrapper and always
zero the segment.

No functional change.

Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
---
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 927861c30afc..9819515ce967 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1646,10 +1646,8 @@ static int __target_submit(struct se_cmd *cmd)
BUG_ON(!sgl);

buf = kmap_local_page(sg_page(sgl));
- if (buf) {
- memset(buf + sgl->offset, 0, sgl->length);
- kunmap_local(buf);
- }
+ memset(buf + sgl->offset, 0, sgl->length);
+ kunmap_local(buf);
}
}