Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2487594ybi; Thu, 18 Jul 2019 09:09:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZXg5iHlKDd+nt+85TKAkGJViHbQFjHpHjaNfynYhsbS9oxdjuH8MVz8WhdaVH96V5Gi3v X-Received: by 2002:a17:902:2aa9:: with SMTP id j38mr48696013plb.206.1563466178619; Thu, 18 Jul 2019 09:09:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563466178; cv=none; d=google.com; s=arc-20160816; b=zhmB6SiMbTMJs9640fgjrHk2mi8v4Kq+QDcXiD1RPw1GCet6n5QMAgZslQ//m7r3Ww BQT0JrTtXgnHDkctL4Up4BW1lseP2honCtePiCg9vdT64/IwrRs1N0QiIVU1XsKmWrTM 6S/jbPIGjig/aObf1JUeWKbFJJeDadBWHEr1YGeKeXlZQtgS/YUe4GrWVNN8gitMxr2h VlhAf9e6xgu2kAzHCtZkaZ0SA4j2o1xEVdYad9Rf0QGN9CJoxr8cd0JU8yYSWNw7v6e+ 7eYNJU1hsUtmFHtp+YDV7e/kCYX40lvAbgPRrCqVGtraTMu8CKvkzuXAgc7Ypas82iZK BByg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=xl8Uazjp4ZMdKRheBvgPvczdOuh+0peuQzPi0D72Ufw=; b=xbc7uggvlKKvKrDBlxP5p3Gbf8dgKVttXx20XLtSNW95DOU56X9VYkGg2AIfzQz+ep hQVdbzyClq1n5QhwnxRlDOY9zcZ0bXQhS9rFQSpp0dirR3ue2sWuDhEp2WxVQxuLY47c XCvlzYwDrhTnZh/sPcKt5sa/JRzrAMMdxXUm30JeYMchyuIGLkDYML2zyqxCT1His/oT YiC0Ld+Hjn2xdjKJ6ugImSlGVEShrzut2GlZ0soEbfawBCyfTB32z+6bcAchd5mlG8HK egm5Ct5sTKouHykTAkH0zhicgUPusv0vo6XKoBN1IxQbMjFEMLHt7QHIIXI4NsyvUje7 6NIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si1388296pji.65.2019.07.18.09.09.22; Thu, 18 Jul 2019 09:09:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730256AbfGRQIc (ORCPT + 99 others); Thu, 18 Jul 2019 12:08:32 -0400 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:2110 "EHLO cmccmta2.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727770AbfGRQIc (ORCPT ); Thu, 18 Jul 2019 12:08:32 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.9]) by rmmx-syy-dmz-app08-12008 (RichMail) with SMTP id 2ee85d309938b31-a1ec6; Fri, 19 Jul 2019 00:07:23 +0800 (CST) X-RM-TRANSID: 2ee85d309938b31-a1ec6 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost (unknown[223.105.0.241]) by rmsmtp-syy-appsvr05-12005 (RichMail) with SMTP id 2ee55d30993a255-0e1ea; Fri, 19 Jul 2019 00:07:23 +0800 (CST) X-RM-TRANSID: 2ee55d30993a255-0e1ea From: Haishuang Yan To: Pravin B Shelar , "David S. Miller" Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Haishuang Yan Subject: [PATCH] openvswitch: Fix a possible memory leak on dst_cache Date: Fri, 19 Jul 2019 00:07:08 +0800 Message-Id: <1563466028-2531-1-git-send-email-yanhaishuang@cmss.chinamobile.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org dst_cache should be destroyed when fail to add flow actions. Fixes: d71785ffc7e7 ("net: add dst_cache to ovs vxlan lwtunnel") Signed-off-by: Haishuang Yan --- net/openvswitch/flow_netlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c index d7559c6..1fd1cdd 100644 --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c @@ -2608,6 +2608,7 @@ static int validate_and_copy_set_tun(const struct nlattr *attr, sizeof(*ovs_tun), log); if (IS_ERR(a)) { dst_release((struct dst_entry *)tun_dst); + dst_cache_destroy(&tun_dst->u.tun_info.dst_cache); return PTR_ERR(a); } -- 1.8.3.1