Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1027598ybt; Fri, 19 Jun 2020 22:06:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZdQ1SFtoM1rKXKSl/c8WGMRUaj0x6yvVNkVWBhbPMUKwtIDHBBixXHLP3buaONcMQAnpd X-Received: by 2002:a17:906:7253:: with SMTP id n19mr6947300ejk.31.1592629600397; Fri, 19 Jun 2020 22:06:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592629600; cv=none; d=google.com; s=arc-20160816; b=HT+OZJjl3eDigxpCoQtYIp8A/kiRU70eg9EUxeCT1IjJqk+g0o3OV3FnJWsPxNyB3e O+dWBx3OkQOleiMXRGHMSgBmLh4TYIKEVgqdHjt5wvqOGjKFPpkUl11waL+VTmuG38a1 feir94qtr35l50d6nGqcoAzGeQSndYlWR3Hd1W0zKxgLGy4X9zOdAknsw0KMnE/8p04t E2CDfO7NRrPFYEuHhWf48BvImT0KESlePi+FXJUeMv7GQKy/rzHw/ufTboAjoMyD6QzY dPQn1QhI1EA2kWYP3k5Cj9bycFhpUTlp6OagEkVDIXoaOkFGAq8dJ9xM2IMiYy/eYmOU Ngxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=NlJDfm7LB9dQEV5cYTkL7iG3dyBeR5NcfC/Gw67Hohg=; b=nRHaKc0DHGR2cE4HuxVnSY3QyUQfMUDQaYeoLMTMq/caC8H/dgHkf3orIhmJPlZG7f oEv6gaMsnaj1vI89lxER71c7lwBnGWmApXD1Oqq5gmC3MpFkJmKwu88EFP76iye5XOxd +kdeWChZpvA6/+nwHCw9Yv9+qwVtb9Qaa7mYyYeuoEdLrZWy6xLwYuvzk259DpNT+vQL 9GKmX/TqxcaFuWCx6D5J0G+FgrjdGDISDu5JxoPbntjc2Rx5HshHfKGJUGioPPAwAs3m fc5KgAn8zbA3U4yuoHeoCJQiGralhuEooL7SXu1JlOxPJiHXcw0CuadYNFU6cc2t2Ng8 ODgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b14si5347249eju.419.2020.06.19.22.06.18; Fri, 19 Jun 2020 22:06:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732460AbgFTDPI (ORCPT + 99 others); Fri, 19 Jun 2020 23:15:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732429AbgFTDPF (ORCPT ); Fri, 19 Jun 2020 23:15:05 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D259C06174E; Fri, 19 Jun 2020 20:15:05 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 3303E127853B9; Fri, 19 Jun 2020 20:15:05 -0700 (PDT) Date: Fri, 19 Jun 2020 20:15:04 -0700 (PDT) Message-Id: <20200619.201504.540882827677086606.davem@davemloft.net> To: zhengbin13@huawei.com Cc: kuba@kernel.org, michael-dev@fami-braun.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com Subject: Re: [PATCH -next] macvlan: Fix memleak in macvlan_changelink_sources From: David Miller In-Reply-To: <20200618132629.659977-1-zhengbin13@huawei.com> References: <20200618132629.659977-1-zhengbin13@huawei.com> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 19 Jun 2020 20:15:05 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zheng Bin Date: Thu, 18 Jun 2020 21:26:29 +0800 > macvlan_changelink_sources > if (addr) > ret = macvlan_hash_add_source(vlan, addr) > nla_for_each_attr(nla, head, len, rem) > ret = macvlan_hash_add_source(vlan, addr) > -->If fail, need to free previous malloc memory > > Fixes: 79cf79abce71 ("macvlan: add source mode") > Signed-off-by: Zheng Bin Bug fixes should never be submitted against net-next. They should instead be submitted against 'net'. Thank you.