RE: [PATCH v2] ufs: fix an NULL check on list iterator

From: Daejun Park
Date: Mon Mar 21 2022 - 19:24:57 EST


Hi Xiaomeng Tong,

>The list iterator is always non-NULL so the check 'if (!rgn)'
>is always false and the dev_err() is never called. Move the
>check outside the loop and determine if 'victim_rgn' is NULL,
>to fix this bug.
>
>Fixes: 4b5f49079c52a ("scsi: ufs: ufshpb: L2P map management for HPB read")
>Signed-off-by: Xiaomeng Tong <xiam0nd.tong@xxxxxxxxx>
>---

Good catch. Free to add my reviewed-by tag.

Reviewed-by: Daejun Park <daejun7.park@xxxxxxxxxxx>

Thanks,
Daejun