Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753799AbcD0KnQ (ORCPT ); Wed, 27 Apr 2016 06:43:16 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:5364 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752041AbcD0KnP (ORCPT ); Wed, 27 Apr 2016 06:43:15 -0400 X-RM-TRANSID: 2ee257209792c5c-90237 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee657209792834-edd68 From: Haishuang Yan To: "David S. Miller" , Toshiaki Makita Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Haishuang Yan Subject: [PATCH] veth: Fix potential memory leak in veth_newlink Date: Wed, 27 Apr 2016 18:42:19 +0800 Message-Id: <1461753739-4803-1-git-send-email-yanhaishuang@cmss.chinamobile.com> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 512 Lines: 23 Free peer netdev when failed to configure peer link or register dev. Signed-off-by: Haishuang Yan --- drivers/net/veth.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index f37a6e6..8bb9fb8 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -472,7 +472,6 @@ err_register_dev: /* nothing to do */ err_configure_peer: unregister_netdevice(peer); - return err; err_register_peer: free_netdev(peer); -- 1.8.3.1