Re: [PATCH v4 2/3] scsi: ufs: rpmb: Decouple device lifecycle from devres to avoid UAF

From: Stanley Jhu

Date: Mon Sep 14 2026 - 12:54:46 EST


On Mon, 2026-09-14 at 11:55 +0200, Bean Huo wrote:
> why uses list_del_init(), list_del() is not enough?

It is. Back to list_del() in v5, and the INIT_LIST_HEAD() that v4 added
to pair with it is gone as well.

> every entry on the list has rdev set, so this check is not needed?

It is not. list_add_tail() only runs after ufs_rpmb->rdev is assigned,
so the check can never be false. Dropped.