Re: [PATCH v2 1/2] phy: sunplus: fix memory leak in update_disc_vol()

From: Markus Elfring

Date: Thu Aug 20 2026 - 12:37:53 EST


> nvmem_cell_read() returns a kmalloc'd buffer that update_disc_vol()
> never freed. Free it after extracting the disconnect-voltage value.

How do you think about to apply the attribute “__free(kfree)” also in such
a function implementation?
https://elixir.bootlin.com/linux/v7.2/source/include/linux/slab.h#L596

Regards,
Markus