[lkml]   [2020]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] veth: fix memory leak in veth_newlink()
From: Rustam Kovhaev <>
Date: Sun, 30 Aug 2020 06:13:36 -0700

> when register_netdevice(dev) fails we should check whether struct
> veth_rq has been allocated via ndo_init callback and free it, because,
> depending on the code path, register_netdevice() might not call
> priv_destructor() callback
> Reported-and-tested-by:
> Link:
> Signed-off-by: Rustam Kovhaev <>

I think I agree with Toshiaki here. There is no reason why the
rollback_registered() path of register_netdevice() should behave
differently from the normal control flow.

Any code path that invokes ->ndo_uninit() should probably also
invoke the priv destructor.

The question is why does the err_uninit: label of register_netdevice
behave differently from rollback_registered()? If there is a reason,
it should be documented in a comment or similar. If it is wrong,
it should be corrected.

 \ /
  Last update: 2020-09-01 22:04    [W:0.070 / U:2.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site