Re: [PATCH 1/2] target: iblock: drop the dead kmap() NULL check

From: Laurence Oberman

Date: Thu Nov 05 2026 - 14:04:03 EST


On Thu, 2026-11-05 at 19:33 +0800, shao.mingyin@xxxxxxxxxx wrote:
> From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
>
> kmap() never returns NULL, so the check after it is dead code.
>
> No functional change.
>
> Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
> ---
> diff --git a/drivers/target/target_core_iblock.c
> b/drivers/target/target_core_iblock.c
> index ea65d39fef88..604fca959f2e 100644
> --- a/drivers/target/target_core_iblock.c
> +++ b/drivers/target/target_core_iblock.c
> @@ -461,8 +461,6 @@ iblock_execute_zero_out(struct block_device
> *bdev, struct se_cmd *cmd)
>   int ret;
>  
>   buf = kmap(sg_page(sg)) + sg->offset;
> - if (!buf)
> - return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
>   /*
>   * Fall back to block_execute_write_same() slow-path if
>   * incoming WRITE_SAME payload does not contain zeros.

Looks good.
Reviewed-by: Laurence Oberman <loberman@xxxxxxxxxx>