[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20140603.191706.1773783531239967313.davem@davemloft.net>
Date: Tue, 03 Jun 2014 19:17:06 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: xiyou.wangcong@...il.com
Cc: netdev@...r.kernel.org, eric.dumazet@...il.com,
cwang@...pensource.com
Subject: Re: [Patch net] rtnetlink: fix a memory leak when ->newlink fails
From: Cong Wang <xiyou.wangcong@...il.com>
Date: Tue, 3 Jun 2014 16:40:47 -0700
> From: Cong Wang <cwang@...pensource.com>
>
> It is possible that ->newlink() fails before registering
> the device, in this case we should just free it, it's
> safe to call free_netdev().
>
> Fixes: commit 0e0eee2465df77bcec2 (net: correct error path in rtnl_newlink())
> Cc: David S. Miller <davem@...emloft.net>
> Cc: Eric Dumazet <eric.dumazet@...il.com>
> Signed-off-by: Cong Wang <cwang@...pensource.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
It's a bit ugly, but I can't come up with a better fix, so applied.
This is difficult because it is the one set of code paths where the
netdev allocator and the register are decoupled.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists