Re: [PATCH net] net: phy: phy_device: free the phy_device on the phy_device_create error path

From: Maxime Chevallier
Date: Fri Feb 23 2024 - 11:08:17 EST


On Fri, 23 Feb 2024 17:01:54 +0100
Maxime Chevallier <maxime.chevallier@xxxxxxxxxxx> wrote:

> When error'ing out from phy_device_create(), the previously kzalloc'd "dev"
> pointer gets overwritten with an error pointer, without freeing it
> beforehand, thus leaking the allocated phy_device. Add the missing kfree
> back.

Disregard , I immediatly realised that this was freed in
phy_device_release in our case. Sorry about the noise.

Maxime