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

Markus Elfring Markus.Elfring at web.de
Thu Aug 20 09:00:14 PDT 2026


> 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



More information about the linux-phy mailing list