[bug report] net: mediatek: mtk_eth_sock: allocate dummy net_device dynamically

Dan Carpenter dan.carpenter at linaro.org
Tue Jul 23 08:59:56 PDT 2024


On Mon, Jul 22, 2024 at 02:28:08AM -0700, Breno Leitao wrote:
> Hello Dan,
> 
> On Fri, Jul 19, 2024 at 06:52:50PM -0500, Dan Carpenter wrote:
> > But it's free here.  (NULL dereference).  I really would suggest moving the
> > free_netdev() to the release function.  The probe and release function are
> > easier to read if they're in mirrored order where every allocation has a
> > matching free.
> 
> Thanks for reporting it. It seems a real problem at the error path,
> indeed.
> 
> I've hacked a patch with your suggestion. how does it look like?
> 

Looks great, thanks!

Reviewed-by: Dan Carpenter <dan.carpenter at linaro.org>

regards,
dan carpenter




More information about the Linux-mediatek mailing list