Re: [PATCH] Bluetooth: mgmt: copy pending command data under the list lock

From: Cen Zhang

Date: Thu Jun 18 2026 - 13:32:01 EST


Hi Luiz,

> Or we could just add a kref to mgmt_pending_cmd so mgmt_pending_find
> can return a reference which is then unref'd when finished accessing
> it.

Thanks for the review and suggestion.

I looked into the kref approach. It does look cleaner, but it changes the
lifetime contract of mgmt_pending_find() and requires auditing all callers
and the removal/completion paths. I am not fully confident I can make that
broader mgmt_pending_cmd lifetime change correctly for this.

If you would prefer to make the kref-based change, I would really
appreciate it and would be happy to keep testing it with my reproducer.
If you would prefer me to respin it instead, I may need more specific
guidance.


Best regards,
Cen Zhang