Re: [PATCH] PCI/DOE: Fix double free of a duplicate feature's sysfs name
From: Donggeun Yoo
Date: Mon Sep 28 2026 - 01:33:17 EST
On Mon, 28 Sep 2026 15:19:32 +1000, Alistair wrote:
> On Mon, 2026-09-28 at 12:50 +0900, Donggeun Yoo wrote:
> > Leave the name to pci_doe_sysfs_feature_remove(), which already frees
> > it for every entry.
>
> What about adding a NULL check in pci_doe_sysfs_feature_remove()
> instead? Seems silly to keep duplicate but unused names allocated until
> teardown.
That works too, and I considered it. I went with dropping the kfree()
because freeing them in one place seemed reasonable, and I thought the
cost was small.
If there are no other views in a day or so, I'll send a v2 your way.
Thanks for the review!
Donggeun